How to use OrderSend() function to open a order in EA,please give a example,thank you. - page 2

amin_mohammadi  
luenbo:

No, I wanted to leave SL in 0 but after this error I thought it shouldn't be 0, so I changed it to an unreachable value.anyhow, when it was 0 the same error was thrown.

Alain Verleyen  
amin_mohammadi:
I don't know what is that? now my expert opens sell orders but it needs more pips to open buy order.
Your stops (SL/TP) need to be at least SYMBOL_TRADE_STOPS_LEVEL points from open price. You have to check what is this value for the symbol you trade.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Price Constants - Documentation on MQL5
amin_mohammadi  
angevoyageur:
Your stops (SL/TP) need to be at least SYMBOL_TRADE_STOPS_LEVEL points from open price. You have to check what is this value for the symbol you trade.
Great, thank you, I really need this :D