if(OrderMagicNumber()==1 && OrderSymbol()==Symbol()) //if Trade==BUY
There is no check for whether the trade is a BUY.
if(Close[1]>OrderStopLoss()+atr && Close[1]>OrderOpenPrice()+atr)
Why are you using Close[1]? I think that you should be using OrderClosePrice().
For a BUY, you should be checking that the new SL is higher than the current SL, lower for a SELL.
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
Hello, everyone. Ich have coded this here:
The problem is that the stoploss keeps moving on every tick. I know it is because of the "-0.0005", but I would like to keep that margin. What could I do to set the stoploss at that level, but prevent it from moving on every tick?
Thank you very much in advance.