I am using the same EA on several different charts. I am also using trade context monitoring via Global variables and RefreshRates() to update predefined variables. However I am still getting Error #129 returned occassionaly. Can anyone tell me why the following piece of code does not always give error free trading.
Very frustrated
BigAl
if (TradeBusy() < 0) {Print(Symbol(), " Trade Context is still busy when attempting to open trade");return(0);}
GetOrderDetails();
while (RefreshRates()==false) Sleep(10);
Result = OrderSend(Symbol(), OP_BUY, MyLots, Ask, MarketInfo(Symbol(), MODE_SPREAD) + 1, 0, 0, NULL, 0, 0, Blue);
if (Result < 1)
{
Print("Last Error was ", GetLastError());
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I am using the same EA on several different charts. I am also using trade context monitoring via Global variables and RefreshRates() to update predefined variables. However I am still getting Error #129 returned occassionaly. Can anyone tell me why the following piece of code does not always give error free trading.
Very frustrated
BigAl
if (TradeBusy() < 0) {Print(Symbol(), " Trade Context is still busy when attempting to open trade");return(0);}
GetOrderDetails();while (RefreshRates()==false) Sleep(10);
Result = OrderSend(Symbol(), OP_BUY, MyLots, Ask, MarketInfo(Symbol(), MODE_SPREAD) + 1, 0, 0, NULL, 0, 0, Blue);
if (Result < 1)
{
Print("Last Error was ", GetLastError());
}
TradeNotBusy();