Currency pair USDJPY yesterday reached the light HFT selling pressure zone that was noted at 106.84 and above. All bullish attempts were accurately stopped here
Currency pair USDJPY yesterday reached the light HFT selling pressure zone that was noted at 106.84 and above. All bullish attempts were accurately stopped here
Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.
Currency pair USDJPY yesterday reached the light HFT selling pressure zone that was noted at 106.84 and above. All bullish attempts were accurately stopped here
Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.
Currency pair USDJPY yesterday reached the light HFT selling pressure zone that was noted at 106.84 and above. All bullish attempts were accurately stopped here and USDJPY also closed within this area.
Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.
Currency pair USDJPY yesterday reached the light HFT selling pressure zone that was noted at 106.84 and above. All bullish attempts were accurately stopped here and USDJPY also closed within this area.
Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.
There is EA MQL5, simple EA Buy pending order
How to add Money Management Fixed Risk in its EA,
meaning the modification of EA to auto lot size depending on the balance of his account,
Please the master coding ask for his advice.
PHP Code:
#include <Trade\Trade.mqh>
// exported variables
input double Lots5 = 1;
input int Stoploss5 = 5;
input int Takeprofit5 = 100;
input int PriceOffset5 = 0;
// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
NDigits = Digits();
if (NDigits == 3 || NDigits == 5) PipValue = 10;
if (AccountInfoInteger(ACCOUNT_TRADE_EXPERT) == false)
{
Print("Check terminal options because EA trade option is set to not allowed.");
Comment("Check terminal options because EA trade option is set to not allowed.");
}
if (false) ObjectsDeleteAll(0); // clear the chart
Comment(""); // clear the chart
//---
return(0);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
if (false) ObjectsDeleteAll(0);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
if (Terminated == true)
{
Comment("EA Terminated.");
}
OnEveryTick1();
}
//+------------------------------------------------------------------+
//| Get Low for specified bar index |
//+------------------------------------------------------------------+
double Low(int index)
{
double arr[];
double low = 0;
ArraySetAsSeries(arr, true);
int copied = CopyLow(Symbol(), PERIOD_CURRENT, 0, Bars(Symbol(), PERIOD_CURRENT), arr);
if (copied>0 && index<copied) low = arr[index];
return (low);
}
//+------------------------------------------------------------------+
//| Get the High for specified bar index |
//+------------------------------------------------------------------+
double High(int index)
{
double arr[];
double high = 0;
ArraySetAsSeries(arr, true);
int copied = CopyHigh(Symbol(), PERIOD_CURRENT, 0, Bars(Symbol(), PERIOD_CURRENT), arr);
if (copied>0 && index<copied) high=arr[index];
return(high);
}
//+------------------------------------------------------------------+
//| Get Close for specified bar index |
//+------------------------------------------------------------------+
double Close(int index)
{
double arr[];
double close = 0;
ArraySetAsSeries(arr, true);
int copied = CopyClose(Symbol(), PERIOD_CURRENT, 0, Bars(Symbol(), PERIOD_CURRENT), arr);
if (copied>0 && index<copied) close = arr[index];
return (close);
}
//+------------------------------------------------------------------+
//| Get Open for specified bar index |
//+------------------------------------------------------------------+
double Open(int index)
{
double arr[];
double open = 0;
ArraySetAsSeries(arr, true);
int copied = CopyOpen(Symbol(), PERIOD_CURRENT, 0, Bars(Symbol(), PERIOD_CURRENT), arr);
if (copied>0 && index<copied) open = arr[index];
return (open);
}
//+------------------------------------------------------------------+
//| Get current bid value |
//+------------------------------------------------------------------+
double Bid()
{
return (SymbolInfoDouble(Symbol(), SYMBOL_BID));
}
//+------------------------------------------------------------------+
//| Get current ask value |
//+------------------------------------------------------------------+
double Ask()
{
return (SymbolInfoDouble(Symbol(), SYMBOL_ASK));
}
//+------------------------------------------------------------------+
//| Is there an error |
//+------------------------------------------------------------------+
bool IsError(MqlTradeResult& result, string function)
{
if (result.retcode != 0 && result.retcode != TRADE_RETCODE_DONE && result.retcode != TRADE_RETCODE_PLACED)
{
Print("Function: ", function, " Error: ", result.retcode, " ", result.comment);
return (true);
}
else
Print("> Executed: [", function, "]");
return (false);
}
bool IsError(CTrade& trade, string function)
{
if (trade.ResultRetcode() != 0 && trade.ResultRetcode() != TRADE_RETCODE_DONE && trade.ResultRetcode() != TRADE_RETCODE_PLACED)
{
Print("Function: ", function, " Error: ", trade.ResultRetcode(), " ", trade.ResultRetcodeDescription());
return (true);
}
else
Print("> Executed: [", function, "]");
return (false);
}
//+------------------------------------------------------------------+
//| Get indicator value back |
//+------------------------------------------------------------------+
double GetIndicator(int handle, int buffer_num, int index)
{
//--- array for the indicator values
double arr[];
//--- obtain the indicator value in the last two bars
if (CopyBuffer(handle, buffer_num, 0, index+1, arr) <= 0)
{
Sleep(200);
for(int i=0; i<100; i++)
{
if (BarsCalculated(handle) > 0)
break;
Sleep(50);
}
int copied = CopyBuffer(handle, buffer_num, 0, index+1, arr);
if (copied <= 0)
{
Print("CopyBuffer failed. Maybe history has not download yet? Error = ", GetLastError());
return -1;
}
else
return (arr[index]);
}
else
{
return (arr[index]);
}
return 0;
}
//+------------------------------------------------------------------+
//| Building blocks |
//+------------------------------------------------------------------+
void OnEveryTick1()
{
if (NDigits == 3 || NDigits == 5) PipValue = 10;
OncePerBar2();
}
void OncePerBar2()
{
static datetime Old_Time;
datetime New_Time[1];
// copying the last bar time to the element New_Time[0]
int copied = CopyTime(Symbol(), Period(), 0, 1, New_Time);
if (copied > 0) // ok, the data has been copied successfully
{
if (Old_Time != New_Time[0]) // if old time isn't equal to new bar time
{
Old_Time=New_Time[0]; // saving bar time
BuyPendingOrder25();
}
else
{
return; // still the same bar
}
}
else
{
Alert("Error in copying historical times data, error =",GetLastError());
ResetLastError();
return;
}
}
void BuyPendingOrder25()
{
double price = NormalizeDouble(High(2), NDigits) - PriceOffset5*PipValue*Point();
double SL = price - Stoploss5*PipValue*Point();
if (Stoploss5 == 0) SL = 0;
double TP = price + Takeprofit5*PipValue*Point();
if (Takeprofit5 == 0) TP = 0;
//--- prepare a request
MqlTradeRequest request;
ZeroMemory(request);
request.action=TRADE_ACTION_PENDING; // setting a pending order
request.magic = 1; // ORDER_MAGIC
request.symbol = Symbol(); // symbol
request.volume = Lots5; // volume in 0.1 lots
request.sl = SL; // Stop Loss is not specified
request.tp = TP; // Take Profit is not specified
request.deviation = 3; // deviation in 5 points
request.price = price;
request.type_time = ORDER_TIME_SPECIFIED;
request.expiration = TimeTradeServer()+PeriodSeconds(PERIOD_D1)-2;
//--- form the order type
request.type = ORDER_TYPE_BUY_STOP; // order type ORDER_TYPE_BUY_LIMIT, ORDER_TYPE_SELL_LIMIT, ORDER_TYPE_BUY_STOP, ORDER_TYPE_SELL_STOP
//--- form the price for the pending order
MqlTradeResult result;
ZeroMemory(result);
OrderSend(request,result);
// check the result
if (!IsError(result, __FUNCTION__))
{
}
}
Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.
me as newbie in the field of MQL coding please permission to open this thread ...
If the moderator is not welcome or there is already a similar thread, please invite me to delete it ...
Frankly, I am confused to look for the problems that come out in every code I make ...
This is what it is ,, and it should search in different threads for every problem that arises ...
So, I want to be grouped into one, so easy to find ...
To the point, I created this thread to unify the problems encountered by the beginner coder (like me) in terms of MQL coding, especially MQL4. Suppose my EA codes have problems with their Order Modify, and there are master coding passes or the residents of MT5 who know the problem solving + answer it better. So do not have to look at the thread one by one from the thread in question with the problem coded, where the TS of the thread is also not every time online continue.
So, with one thread it's better to discuss coding with a passing coding master or MT5 resident who understands the problem of coding ...
The goal is to better help the beginner coder, like me, in understanding every coding used.
So even though the coding copy, we still understand the coding used. Gratitude from there we can make EA that really profitable as desired.
For master coding + residents of MT5 who know the problem solving, please voluntarily share, so that Indonesian coder can be more advanced again and increasing quality ...
Note: Let the newbie coder know very well about the codingan, please share the codingannya and discussion than in the form already so EA ...
Add confused
Though trading on financial markets involves high risk, it can still generate extra income in case you apply the right approach. By choosing a reliable broker such as InstaForex you get access to the international financial markets and open your way towards financial independence. You can sign up here.
There are currently users online. members and guests
Threads:
Posts:
Member: