Strange invalid stops problem when placing pending buy stop order
if(OrdersTotal()==0) { request.symbol =Symbol(); request.volume =Lots; request.deviation =10000; request.type_filling =ORDER_FILLING_IOC; request.action =TRADE_ACTION_PENDING; request.price =sell_stop_price-10*_Point; //request.stoplimit =sell_stop_price-10*_Point; request.tp =sell_stop_price-TP*_Point*10; request.sl =buy_stop_price+SL*_Point*10; request.type =ORDER_TYPE_SELL_STOP; request.type_time =ORDER_TIME_GTC; //request.expiration =ORDER_TIME_SPECIFIED; OrderSend(request,result); ZeroMemory(request); old_buy_stop_price=buy_stop_price; old_sell_stop_price=sell_stop_price; }
- www.mql5.com
Yeah, that's true, but I tried placing it very far e.g. 100 pips away from the current price but still got the same error. But like a said I had something else fundamentally wrong in my EA and after fixing it I believe it works OK.
Thanks!
Br, Candles
EDIT:
As expected it works perfectly now :)
Yeah, that's true, but I tried placing it very far e.g. 100 pips away from the current price but still got the same error. But like a said I had something else fundamentally wrong in my EA and after fixing it I believe it works OK.
Thanks!
Br, Candles
EDIT:
As expected it works perfectly now :)
I'm confused with this problem. Below are the parameters and still I get the "invalid stops" error:
rates[i].close=1.29171 rates[i].close is the close of the bar at which I'm placing the pending buy stop order i.e. the current price.
request.price=1.29185 request.price is the price at which I'm placing the pending buy stop order.
request.tp=1.31175 request.tp is the target point of my pending buy stop order.
request.sl=1.28736 request.sl is the stop loss of my pending buy stop order.
As you can see the prices are correct, but regardless I get that error :(
Below is the code for the order placement: