1)
if (OrderType() == OP_BUY)
if (OrderType() == OP_SELL)
order must be selected by OrderSelect() function.
2)
OrderModify(tck,0,
supposed to be OrderOpenPrice()
3)
diff = (Close[0] - op)/point;
u should use NormalizeDouble
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys,
I've been trying to code an EA that moves the Stop to BE + 1 after price moves a certain amount of pips/ticks into profit, but I have been unable to get it to work. I searched through the forum and found similar examples of trailing stops and moving stops, but was unable to get them to work as I want them to. Basically, I want the Stop to be moved for an order that is open to BE + a certain amount of pips (a variable I call SL) after price moves a certain amount of pips/ticks in my direction (a variable I call Ticks).
Here is what I have so far. Any help is appreciated.