Adaptive ATR-ADX Trend

v10.3
Adaptive ATR-ADX Trend

Constructs the trailing ATR stop above or below the price, and switches
directions when the source price breaks the ATR stop. Uses the Average
Directional Index ( ADX ) to switch between ATR multipliers. The higher
multiplier is used when the ADX is rising, and the lower ATR multiplier
is used with the ADX is falling. This ADX criteria further widens the gap
between the source price and the trailing ATR stop when the price is trending,
and lessens the gap between the ATR and the price when then price is not
trending.

The ATR-ADX stop is effectively a double adapative stop that trails the price,
by both adapting to the true range of the price, and the average directional
change. When the stop is below the price (long trade) the value never decreases
until the price intersects the stop, and it reverses to being above the price
(short trade). When the stop is above the price it will never increase until
it is intersected by the price. As the true range and ADX change, the stop
will move more quickly or more slowly.

First, if the ‘Above Threshold’ box is checked,the falling (smaller) multiplier
will be used regardless once the ADX rises above a certain threshold (default > 30).
The ATR will effectively rise faster once the price enters ‘very trendy’ mode.
Typically, ADX > 20/25 is used in classic ADX trading (which I have found
unprofitable through backtesting). The idea behind this extra multiplier criteria
is that once the price starts trending ‘very’ well, a top/bottom is likely near,
and when that top comes the price will quickly rebound. Experienced traders know
exactly what I am describing. Play around with an ADX/DI indicator using this
stop system in tandem and it will be found that many successful trades are entered
when the market is not trending (i.e. < ADX < 25), and exited once/if the price
enters ‘very trendy’ mode above 30 and the ATR changes (stopped out).

Second, heiken-ashi bars can be introduced to the ATR stop system. This is the same
thing as just switching the chart to Heiken Ashi mode, but without having to change
the plotting type. I find this useful, so that things like pivot lines can be
preserved to their correct calculations, while the benefit of heiken ashi bars can
still be enjoyed. Be advised that with each tinkering that extends the life of the
ATR trend, the odds of that same trend changing near the top/bottom are reduced,
so as always there is a trade-off to maximize the time spend in a trade and nailing
a top or bottom.

Third, Different source prices can be used. I have found that HLC3 is best because
it keeps the price from being stopped out in very key areas, set as the default.

Fourth, alert conditions are introduced so that the trader can be warned when the
ATR-ADX changes. These can be used by right clicking the strategy and clicking
“Add Alert…”. Reference the bottom of the script for the names of the alert
conditions.

(original code and description from its author: mortdiggiddy, all credits goes to him).

Code translated from TradingView (pinescript) code by a request in the english forum.

 

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. Pepsmile • 06/29/2018 #

    Thanks Nicolas !

  2. Demon • 06/29/2018 #

    Merci beaucoup pour cette contribution au catalogue des stops.

  3. stefou102 • 06/29/2018 #

    Thx Nicolas! trying to test this indicator in an automated strategy but I’m becoming crazy because when I call the indicator and then simply Graph it in the chart result, there is a discrepency in the value of the indicator vs it’s “called” version in the strategy. How is that possible? In the strategy I’m calling it via the command

    • Nicolas • 06/29/2018 #

      In this case, I suggest to add the indicator’s code directly into your strategy.

  4. stefou102 • 06/29/2018 #

    mystoploss=call “Adaptative ATR-ADX”(MedianPrice)
    GRAPH mystoploss as “Adapt”

  5. schilds • 06/29/2018 #

    Nicolas, Could you explain lines 35, 37 and 38 please. Unless I’m missing something they can result in a division by zero attempt.

    • Nicolas • 06/29/2018 #

      Should not if adxlen variable is superior to 0.

  6. AussieTrader • 06/29/2018 #

    Nicolas, Can you explain the numerator logic – e.g. Line 35 is (sTR[1] – sTR[1]) which would appear to be either null or zero.

    • Nicolas • 06/29/2018 #

      You are right, this is useless. Since I converted it from another programming language, I assume it was in the original code…

  7. Ass13 • 06/29/2018 #

    bonjour nicolas j’aime bcoup votre indicateur

  8. bharatjai • 06/29/2018 #

    Script ‘Adaptive ATR’ has been saved
    line 24: no viable alternative at input ‘lr’

    Getting above error. Please help to resolve the same.

    • Nicolas • 06/29/2018 #

      download the itf file and import it into your platform.

  9. Francis3332 • 2 days ago #

    Bonjour à tous,
    J’aime beaucoup cet indicateur et j’aimerais pouvoir l’utiliser sur la dernière version de prorealtime V12 avec l’option “Utiliser une autre pèriode” cad pouvoir, par exemple, visualiser l’indicateur en 3mn sur un graph 2mn.
    Quelqu’un pourrait-il m’aider ?
    Merci d’avance.
    Bonne journée.
    Fran6

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+20 more likes

Related users ' posts
supertiti Bonjour Nicolas, Je ne comprend pas bien , le trend change de couleur quand les prix sont a...
Nicolas Oui ce serait possible, cependant l'indicateur est bien prévu pour conserver la couleur de l...
supertiti Quand tu pourras si tu peux nous coder la troisième couleur cela améliorerait les trades cou...
Nicolas remplacer les valeurs de coloured(0,255,0) par coloured(r,g,b) et ajouter ces noms de variab...
mohamed merci Nicolas!
sacram14 Merci Nicolas pour ce set-up que je ne connaissais pas ! J'ai tenté de reprendre le code pou...
Nicolas Just add it on the price series.
yomisadiku Hello Nicolas, Can I use high and low price at lines hh=max(hh,close) and ll=min(ll,close) ...
Nicolas Yes you can do that, the impact will be that the trailing stop line will be much close to th...
JJ Tec Hola. Me gustaría contactar contigo para ver la estrategia..
nilsla1981 Has someone already tested in real ?
Lucas0000 Hola. estoy buscando un programador en proorder, para hacer un programa basado en el Q-trend...
LucioleLucide Clean view, thanks for sharing
dertopen hi where i can found the window for candle configuration?
paolosab69 Ciao! . I have seen the pictures that explain this metod but i don't understand when is mome...
Thomas
5 years ago
Thomas Como? no intiendo. Can you write in english . It works! Download the itf file.
Thomas New Version comin soon...
CHARLESRACHELLE OLA NAO SERVE PARA MT4?
Vinks_o_7
5 years ago
IV Mcm I've always wondered how to make the ADX faster, thank you!
Vinks_o_7 You welcome !
Vinks_o_7 Another variation that may be more accurate : we calculate the average of normalized DI's in...
nfulcher Please could someone explain how the following code is calculated:- iDI = TEMA[3](DI[DI2]...
oakenstream Jan, I find sometimes that the priceexit variable is never set. It seems to happen when the ...
Matt66612 I do not understand the first time I launch the backtest I got the same result as you. but ...
juanj
5 years ago
juanj I have actually completely redesigned this indicator with loads of improvements, so will res...
ottimo Thank you Nicolas, great indicator, N. 1
tikigai Merci Nicolas! First Happy new Year 2020. Very good indicator BUT (yes the french "oui, m...
Nicolas Whats prorealtime version? Did you try in version prior to v11? indicator's call and loop ca...
Marcos Alvarez Dominguez Hello Nicolas, is it possible to stablish a bullish screener for this indicator when the cen...
Nicolas Please open a topic in the screener section to ask for this specific query.
zaher123 Hello, the indicator doesn't show up anything on the screen, any suggestions please?
Nicolas Apply it on the price chart. The indicator plot just one single line. There are two in the...
jamesoc Hi Nicolas, do you happen to know if there is an indicator that can be applied to charts, to...
gustavobp Buenos dias Nicolas, al agregar tu indicador no me reconoce la variable Price ni en la linea...
joobeng Sorry, I solved the problem. I have add the CBL indicator using the spanner icon on the pric...
Nicolas Adjust the price settings for the Y Axis to use the price only.
XXXXVII Hello Your indicator is interesting. However, I can't see the orange line. Do you have ...
Nicolas Definition of CustomClose: https://www.prorealcode.com/documentation/customclose/ [2] means...
Bard Just wondered Nicolas, say you had set DEFPARAM CumulateOrders = True, is there anyway for t...
Bard Sorry pls ignore last image, try this - it actually has the Dev Stop indicator! https://www...
Appsoluxions Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Nicolas Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Appsoluxions Cool. Thanks for the response.
Domenec Claro Juanjo de todas maneras en deinversoratrader.com tienes estsos osciladores evolucionad...
Dron Hola Domenec, en la descripción hablas del indicador velas de colores, no lo encuentro en la...
Domenec Hola Dron mira en el blog deinversoratrader.com en formacion indicadores ahi hay varios grat...
AGTrader Interesante, muy visual Doc. Felicidades!!!
Andraxx simplemente impresionante Dom...te sigo en youtube. Me ha gustado tu canal. Gracias por comp...

Top