Another ATR Trailing Stop

v10.3
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”
    IF SHORTONMARKET AND close > TS THEN
    BUY AT MARKET
    ENDIF

    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?
    Thanks
    Dave

    • Nicolas • 09/24/2019 #

      Just add it on the price series.

  4. yomisadiku • 330 days ago #

    Hello Nicolas,
    Can I use high and low price at lines hh=max(hh,close) and ll=min(ll,close) instead of close ? What impact would that make to my tracking?

    Thank you.
    Ahmed

    • Nicolas • 330 days ago #

      Yes you can do that, the impact will be that the trailing stop line will be much close to the price.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
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 There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
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.....
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands
Emperor.it "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm https://www.prorealcode.com/programming-with-prorealtime/
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: https://www.prorealcode.com/topic/trendline-une-approche-du-trading/ 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 Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...
pincherman Bonjour :-) J'ai coller le script dans prorealtime pour jouer avec le supertrend et j'ai un...
Nicolas Vous l'avez sans doute collé au mauvais endroit, dans l'éditeur de code pour les stratégies,...
Guillaume Mcm I gave the above message fix ;)
Tradingrob Is it possible to put the itf-file in the right way here in Prorealcode? so the right 'trend...
Guillaume Mcm Update link ;) https://www.prorealcode.com/topic/trend-histogramme-cci-mise-a-jour-suite-...
Screw27 Hi man, I installed the indicator and i don't know why but my graph it is so big
HelixKing sounds interesting I'll take a look

Top