Invalid order for OP_BUY/SELL WITH SL TP - page 2

 

"...Just one question, is

Ask

equivalent to

MarketInfo (Symbol(), MODE_ASK)

?"

Answer : Not equivalent.

"MarketInfo(...)" always returns actual data.

"Ask" is guaranteed to contain the actual data in only 2 cases:
1) at the beginning of "start()" function;
2) immediately after "RefreshRates()" invocation.

Please, see => https://docs.mql4.com/predefined/variables/ask .

 

I think i have found why it doesn't work:

I'm using an Oanda practice acount, and i think SL and TP are disable with ORDER_BUY.

If i replace OP_BUY with OP_BUYLIMIT it's working well!!!