Another ATR Trailing Stop

Another ATR Trailing Stop

Closely following the price with the Another trailing stop ATR (Average True Range), a based trend following indicator. The idea of this indicator is to closely following the price to get out quickly if the price tends to not move enough to ensure the trend is profitable.

This version uses declining ATR to closely adapt its level to the price. The trailing stop line is following the highest Close (green when it is bullish) or Lowest Close (red when it is bearish) by adding or subtracting the ATR value multiplied with the “mult” setting.

If the ATR (aka price volatility) is ascending, then the trailing stop keep its previous level. When it is declining, the trailing stop level adapt its value according to the current trend:

  • Long trend: if the new calculated level is higher than the previous one
  • Short trend: if the new calculated level is lower than the previous one

The ATR trailing stop has 2 modes: (“mode” setting)

  • mode=0 ; the trend line will keep the same level each time a cross over occur
  • mode>0 ; the trend line will take the highest or lowest Close level each time a cross over occur

The chosen mode of the trailing stop line behavior depends of your own trading style, traded instrument and timeframe.

Idea come from this topic in the indicator’s forum: ATR TRAILING STOP

If you have other ideas, nevermind opening a new topic in the forum describing what you have in mind. The community will try to help you achieving your goal!


Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. s00071609 • 09/24/2019 #

    I tried this indicator to trail stop. Problem i am facing is that, when there is a trend change, say from bullish to bearish. For example, In a short entry – I get stopped out when price moves back and touches the support line of Bullish Trend. While the purpose of stop is to sell when the BEARISH upper line is crossed (when short in market), positions get stopped out at start of the trend. I think this is unintended consequence. I tried similar another indicator, same thing happens. How would be possible to BUY only when RED line above is crossed in Short Entry and Bottom Green line when Long?

    • Nicolas • 09/24/2019 #

      Use the color variables R and G to test if the trend is bullish (R=0) or bearish (R>0).

  2. s00071609 • 09/24/2019 #

    Where can i find the syntax to test the colour of the line, I am calling the indicator values at the moment, this is my current code,

    ts= Call “ATR STOP2”

    I tried few syntax but it gives error. Could you please help?

    • Nicolas • 09/24/2019 #

      You should open a new topic to discuss about the strategy and its coding.

  3. dvlukic • 09/24/2019 #

    Hello Nicolas,
    How could plot this indicator over the price series?

    • Nicolas • 09/24/2019 #

      Just add it on the price series.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
mikechan883 Thanks so much for your great help! May I ask you for further favor? Can you show me how to...
AndPar Buongiorno Nicolas, vorrei provare questo indicatore, ma quando lo inserisco in PRT mi vengo...
Nicolas Basta aggiungerlo al prezzo
5 months ago
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
CederTrader Hi Denis, does this indicator add to the chart as panel, or on the candles. Thanks
Nicolas Add it on the price chart as described in this video:
Denis Hello Nicolas and Ceder Trader, Sorry, I only just saw your replies. The indicator is alre...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi If MagicTrend <> MagicTrend[1] then it's Green or Red
raffa58 Buonasera Roberto, ho provato ad usare questo indicatore inserendo l'istruzione di cui sopr...
Leo_da_Pisa A really nice indicator. Can easily be used as a strategy. I've tried a few trend indicators...
kats Bonjour, j'ai essayé de faire afficher cet indic en temps 5 mn sur le 1 mn et c'est Hiroshim...
Nicolas Il suffit d'ajouter l'instruction TIMEFRAME(5 minutes,updateonclose) en tête du code
diegofe_2000 cordial saludo Nicolas, una pregunta senciLla : Como coloco un STOPS en un maximo o un mini...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors..... "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm
StephFor //ind1 = ZigZagPoint[2*averagetruerange[200]](close) avr = 3 //3% ind1 = ZigZag[avr](close...
Manu L. @Steph un grand merci pour ton aide mais :-( J'ai copier le code tel quel mais cependant j...
AlphaMauss Je n'ai pas réussi à faire fonctionner l'indicateur avec le code fourni en commentaire sur P...
Daniele Maddaluno Écrivez-moi où vous préférez you can easily find me on LinkedIn
AK27 C'est payant visiblement sur linkdin je peux pas vous envoyer, discord vous avez ?
Nicolas C'est dans ce sujet: M...
Pensera Bonjour Nicolas, comment est-il possible de backtester cet indicateur? cela fait une erreu...
Nicolas Oui bien sûr, il doit y avoir pas mal de sujets dans le forum à ce propos.
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Stenozar Hi @Nicolas, how can I put the bands on price? Thanks, Stefano
mickey992 salut merci pour ton partage et ton travaille
patapouf Hi Vivien René I just discovered your “Ordered trend-following stocks Screener”. Great work...
Nicolas Oui c'est possible. Merci de ne pas poster des demandes qui sont hors sujets. Pour les deman...
Igor Merci pour cet itf. Question : comment faire pour instruire un screener ?
Nicolas tester le croisement du Close avec la première valeur de l'indicateur : "TrailingStop", faci...
Nicolas Avec l'assistant de création pour les screeners c'est possible, le code est compatible.
maxlys Merci Nicolas, avec l'assistant cela donne le code ci dessous. Est-ce correct ? De plus est-...
Nicolas Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...