Can you tell me why that stoploss doesn't work?
It doesn't seem to be far away from bid/ask?
It is in the backtester so min stop level is zero as you can see.
Can you tell me why that stoploss doesn't work?
It doesn't seem to be far away from bid/ask?
It is in the backtester so min stop level is zero as you can see.
no but
ticket=OrderModify(OrderTicket(), OrderOpenPrice(), Stopper*_Point, PriceTarget*_Point, 0, Yellow);
It looks like a long order? So the stoploss value should be less than the bid. In your case, 108.285 > 108.24. It's an invalid stop.
Yes, that's true.
I fixed it and now I am getting this.
2016.05.01 16:30:08.092 2003.08.29 21:32 Tokyo USDJPY,M15: Error in OrderModify. Error code=130 -> 2016.05.01 16:30:08.092 2003.08.29 21:32 Tokyo USDJPY,M15: SetSLTP: OrderModify(#82 @117.232) - SL(0.000): 116.885 TP(117.332):117.332 Ask:116.932 Bid:116.93 2016.05.01 16:30:08.092 2003.08.29 21:32 Tokyo USDJPY,M15: 0 2016.05.01 16:30:08.092 2003.08.29 21:32 Tokyo USDJPY,M15: OrderModify error 130 2016.05.01 16:30:08.092 2003.08.29 21:32 Tokyo USDJPY,M15: Setting stop loss: 116.885 2016.05.01 16:30:08.092 2003.08.29 21:32 Tokyo USDJPY,M15: price=117.232 stoploss=116.885 bid=116.93 ask=116.932
Now the stoploss is less than the bid but it is still complaining.
I changed the ordermodify to
ticket=OrderModify(OrderTicket(), OrderOpenPrice(), Stopper*_Point, PriceTarget*_Point, 0, Yellow);
Yes, that's true.
I fixed it and now I am getting this.
Now the stoploss is less than the bid but it is still complaining.
I changed the ordermodify to
yes you should at least
if(OrderType()==OP_BUY) { // Do This. } else if(OrderType()==OP_SELL) { // Do This. }otherwise you keep running into problems.
Hello,
It is a buy (long) order so it should be correct.
For sell you are right.
This is for a SELL order:
2016.05.01 19:56:48.380 2003.08.01 05:45 Tokyo USDJPY,M15: Error in OrderModify. Error code=130 -> 2016.05.01 19:56:48.130 2003.07.29 05:45 Tokyo USDJPY,M15: SetSLTP: OrderModify(#60 @119.010) - SL(0.000): 119.297 TP(118.910):118.910 Ask:119.252 Bid:119.25 OrderType: 1 2016.05.01 19:56:48.130 2003.07.29 05:45 Tokyo USDJPY,M15: 0 2016.05.01 19:56:48.130 2003.07.29 05:45 Tokyo USDJPY,M15: OrderModify error 130 2016.05.01 19:56:48.130 2003.07.29 05:45 Tokyo USDJPY,M15: Setting stop loss: 119.297 2016.05.01 19:56:48.130 2003.07.29 05:45 Tokyo USDJPY,M15: price=119.01 stoploss=119.297 bid=119.25 ask=119.252
Not sure what is going on...
SL is above ask so should be OK.
EDIT: this code does the trick
https://book.mql4.com/trading/ordermodify
Thanks all!
- book.mql4.com
Can you tell me why that stoploss doesn't work?
It doesn't seem to be far away from bid/ask?
It is in the backtester so min stop level is zero as you can see.
Excuse me, but the sl can be OrderOpenprice in OrdemModify fuction? I cannot seti it because MT4 doesn't work and send me error 130...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I know this has been covered a trillion times everywhere but I am stuck on setting a stoploss:
My code:
Which gives the following error in the Journal: