run the test again, print Bid and Ask price along with OrderOpenPrice() and last_tp_s
Also, add
Print("******************************** stop_level = ", MarketInfo(Symbol(), MODE_STOPLEVEL), " freeze_level = ", MarketInfo(Symbol(),MODE_FREEZELEVEL), );
Here you go guys:
2008.11.10 08:16:20 2007.01.02 08:49 TrendProfit EURUSD,H1: OrderModify error 130 2008.11.10 08:16:20 2007.01.02 08:49 TrendProfit EURUSD,H1: Order_Type= 1OrderOpen= 1.3189NewSL= 1.3219Bid= 1.3269Ask= 1.3271stop_level= 8 freeze_level= 0
I'm very confused. This is suposed to just work!
Your order is sell at 1.3189
Current price is 1.3269/71
Stop loss must be above 1.3271 + 8 stoplevel
Maybe I was not clear enough. The order is a market order. The current market price has nothing to do with modifying the SL as long as it is 8 pips away from the order opening price, which it is. Having said that my order was open at 1.3189 the new SL is 1.3219 which is clearly 8+ pips away. Why the 130 error?
The current market price has nothing to do with modifying the SL as long as it is 8 pips away from the order opening price,
Wrong.
Wrong.
So what you are saying is i can not modify the SL of an order opened at 1.3189 until price goes above 1.3271 + 8 stoplevel. What kind of sence does that make?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have been strugling all afternoon on a little piece of code that has no reason not to work. It is a simple fucntion to modify existing orders. Here is the code:
Here is the Print from the log:
As you can see from the log i have a OP_SELL order. All my doubles are normalized. The OrderOpenPrice() is well bellow the new SL. Yet i still get a 130 error. Can anyone help?