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 • 302 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 • 301 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
Iván De nada!
lkiklkik merci ! which time frame would be the best .?
Iván Depends on the asset you are trading, so you need to test it first.
Iván
4 weeks ago
Iván I personally like it in daily timeframe
oliTR Many thanks Ivan, I copy/paste your code to try it but could only get a constant stable unif...
Iván Hi, I've copied the code above and it works... what asset are you trying? $indices array ...
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
1 month ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
2 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Iván
2 months ago
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
winnie37 bonjour, une petite idée d'ajout mais que je ne saurai coder, ajouter au stop loss un break ...
sfl This is dangerous, did you see aug 2023 ? I would not run live this algo, need more daata to...
winnie37 could you post the backtest please ?
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas Simple strategy with this indicator is available here: https://www.prorealcode.com/topic/ut-...
FXtonio Nicolas.... MERCI 1 millions de fois, cet indicateur gagne dans 75% des cas en scalping m1 ...
davy42 bonjour, à quel moment apparait le fleche, à l'ouverture ou la fermeture de la bougie? merci
Nicolas
8 months ago
B-Xtrender
B-Xtrender
7
Indicators
Fgats I suspected something like this but in the PRT documentation I couldn't find anything to exp...
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
JS
8 months ago
Trendilo
Trendilo
0
Indicators
Nicolas
9 months ago
Anthony2A Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80. sur drawcandle drawtext et endif. si ...
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...

Top