OrderSend Failed

 
I have an expert advisor running with just one line of code:

OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-20*Point,Ask+2*Point, NULL, 0, 0, Aqua);

What's suppose to happen is that it should keep buying until I'm broke. I'm just testing it this way because this function is not being executed by MetaTrader4.
 
1. Check last error
2. I think your takeprofit level is wrong
 
I was trying to send an order with a take profit level exactly 1 pip above the opening price. It seems that MQL grants orders when take profit levels are above 10 pips. Am I right?
 
it depends from server settings. to know exactly stoplevel value call MarketInfo(Symbol(),MODE_STOPLEVEL)
 
Hi Slawa,

Regarding your comments above - are you saying that the function call MarketInfo(Symbol(), MODE_STOPLEVEL) would provide me with the minimum distance in points that a SL/TP price must be set from the market price?
 
Regarding your comments above - are you saying that the function call MarketInfo(Symbol(), MODE_STOPLEVEL) would provide me with the minimum distance in points that a SL/TP price must be set from the market price?

yeah
 
Great - thanks for that Slawa!
Reason: