Simply get the ATR value and add to your entry price, your example should be correct, as long as your OpenPrice and ATR_Value are correct.
Then you should normalize the price to tick size, instead of Digits, but this is another problem.
Simply get the ATR value and add to your entry price, your example should be correct, as long as your OpenPrice and ATR_Value are correct.
Then you should normalize the price to tick size, instead of Digits, but this is another problem.
i try to print a value
2025.03.27 23:15:28.587 TradeManager (EURUSD,M15) ATR_Value: 10.0 2025.03.27 23:15:28.587 TradeManager (EURUSD,M15) Point(): 2.0 2025.03.27 23:15:28.587 TradeManager (EURUSD,M15) OpenPrice EURUSD 2025.03.27 23:15:28.587 TradeManager (EURUSD,M15) Calculated SL: 21.07903 2025.03.27 23:15:28.587 TradeManager (EURUSD,M15) OpenPrice 1.07903
why return me 21.07903 , but calc [rpbably is not correct anypne have a right calc ?
I used to to this
int OnInit() { atr_handle = iATR(Symbol(), 0, atr_period); ArraySetAsSeries(atr_buf, true); return(INIT_SUCCEEDED); } void OnTick() { if(CopyBuffer(atr_handle, 0, 0, 1, atr_buf) < 0) { Print("UNABLE TO GET REQUESTED DATA FOR ATR. REVERTING."); } double stopLossATR = atr_buf[0] * atr_stop_multiplier; double buy_stopLoss_atr = (ask - stopLossATR) - SL * _Point; double sell_stopLoss_atr = (bid + stopLossATR) + SL * _Point; }
there are also dedicated trend following indicators based on ATR stop as to which you can use for a trailing atr stop loss

- 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 guys how calcolate a stop loss with ATR ? anyone have some example ?
i find but not have a good example
i tryed
but not return me a price correct