Hey, i have the same problem with my EA's. Before the update i had no problems with backtesting.
But know i get the same error "2011.11.14 21:56:12 Core 1 2010.06.03 10:21:00 failed instant buy 1.00 EURUSD at 1.23138 [Invalid request]".
What's happend?
Thanks for help.
I also report the same problem with my EA when using Build 540: "failed instant buy ........ [Invalid Request]". What changed in this build?
Thanx
Try to modify your code like this
MqlTradeRequest mrequest; // Will be used for trade requests MqlTradeResult mresult; // Will be used for results of trade requests ZeroMemory(mrequest); ZeroMemory(mresult);
Same problem with build 540 but ZeroMemory helps.
alexvd:
Try to modify your code like this
Great, thanks, it works!
Best regards
Huckey
hi Alex I add zeromemroy and it works .thnx
void SellOrder(string sym,int magi,double l)
{
//--- prepare a request
MqlTradeRequest request;
MqlTradeResult result;
ZeroMemory(request);
ZeroMemory(result);
request.action = TRADE_ACTION_DEAL; // setting a deal order
request.magic = magi; // ORDER_MAGIC
request.symbol = sym; // symbol
request.volume = l; // volume in lots
request.price = Bid(sym);
request.sl = 0; // Stop Loss specified
request.tp = 0; // Take Profit specified
request.deviation = 4; // deviation in points
request.type = ORDER_TYPE_SELL;
request.comment = TimeToString(TimeCurrent(),TIME_MINUTES);
OrderSend(request,result);
// check the result
if (!IsError(result, __FUNCTION__))
{
}
}
i have the same problem,what did they change in version 540?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all,
a strange thing: I have an expert advisor which works fine in MetaTrader 5.00 build 527 but it doesn't work in build 540 (same machine).
I have double checked that I test with the same code. In Build 540 I get the following error:
2011.11.14 18:26:18 Core 1 2010.01.26 16:06:28 failed instant buy 0.10 EURUSD at 1.40622 [Invalid request]
GetLastError() returns 4756 (Trade request sending failed) and MqlTradeResult of OrderSent returns 10013 (Invalid request).
TIf I try one of the sample Experts installed by default they seem to work.
Now that would mean that there is some error in my strategy which I naturally accept. What I do not understand is why the same code works in MT5 build 527 and not 540.
I try opening my positions by calling this function:
Any ideas?
Best regards
Huckey