Order Send Error 138 (Requote)
sry,i still dont get it...
when iam buying it doesn't matter what the ticket is, right? (only when closing)
so my Ea just keeps buying and I tested with some Print() functions that my EA just comes to the OrderSend() funktion and doesn't care about the rest of the code...
because when i code it like this:
int Ticket = OrderSend();
Print (Ticket);
Ticket isnt shown in the journal...
-----------------
Edit: No you seem to be right, I get nothing at all
Print("1");
OrderSend();
Print("2");
I get also nothing....
So whats the matter with this error, is it caused by the OrderClose function then?
If it fails you should get a -1 in the Experts tab (Journal if using the Strategy tester).
Why don't you do something like this . . .
if(OpenPositionBUY == false && Open[2] < MAx && Close[0] > MAx) { RefreshRates(); if (OrderSend(Symbol(),OP_BUY,0.1,Ask,10,0,0,"Buy Order",123,0,Red) < 0) //Stop Loss still needed { int GLE = GetLastError(); Print("OrderSend failed: OP_BUY @ Ask ", Ask, " Error: ", GLE); }
ok, its not the ordersend... :)
here its 01:30 AM, so I'll keep trying tomorrow....
thx for your help...
Hey,
I am new to MQL (thats why my EA is so simple) and I'm getting this error but I have no idea why...
The solution is probably very simple, but I just don't see it.
I think the best would be just to post my EA code, thanks for your help!