Dynamic ATR

v10.3
Dynamic ATR

Good Day PRT Community

It has been a while since I last shared an indicator to the PRT library so here is something I coded today that might give a more accurate reflection of the Average True Range.

The basic idea was to create an ATR that will adapt to its timeframe by only considering the intraday price movements if a timeframe of smaller than Daily is used or looking only at price data for the week if a Daily timeframe is used. At this stage, Daily is the highest supported timeframe.

The parameters are as follow:

TFMinutes: Enter your timeframe in minutes. All default timeframes are supported up to Daily (i.e. 5m = 5, 1H = 60, 4H = 240, Daily = 1440, etc.)
TFMultiplier1: For those too lazy to work out higher timeframes you can use the multipliers (i.e. to get to 3H timeframe use 60 as TFMinutes and 3 as TFMultiplier1)
TFMultiplier2: Extention to the above functionality
stdDev: standard deviation used to calculate the Relative ATR line
MarketOpenHour: The opening hour of the market

Three different ATR values are calculated:

  1. The total price range for the intraday trading session (TF < Daily) or total price range of the weekly trading data (TF = Daily)
  2. Relative ATR calculated using an average and taking into account standard deviation
  3. Sampled ATR using price data from three different data sets within the evaluation period

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. juanj • 02/02/2019 #

    I have actually completely redesigned this indicator with loads of improvements, so will resubmit to the library as v2.0 (moderators perhaps you can delete this version)

avatar
Register or

Likes

avatar avatar avatar
Related users ' posts
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 ...
bharatjai Script 'Adaptive ATR' has been saved line 24: no viable alternative at input 'lr' Gettin...
Nicolas download the itf file and import it into your platform.
Francis3332 Bonjour à tous, J'aime beaucoup cet indicateur et j'aimerais pouvoir l'utiliser sur la dern...
AGTrader Interesante, muy visual Doc. Felicidades!!!
Andraxx simplemente impresionante Dom...te sigo en youtube. Me ha gustado tu canal. Gracias por comp...
Caribeengeek Bonjour j’avais vu que vous proposiez d’écrire des codes pour ceux qui s’y connaisse pas Mai...
Caribeengeek Les devises unité
Nicolas Merci d'utiliser le forum pour les demandes de programmation personnalisée
jebus89 Big thanks for sharing this :) Seems to work as expected, good stuff.
WarningTrading Comment peut on la comparer ? comme ceci ? cela ne me donne plus le message d'erreur manque...
sally31120 Bonjour, je n'arrive pas à créer ce screener close > supertrend extended2[1] la réponse...
Nicolas voir ce sujet pour un screener basé sur Supertrend Extended: https://www.prorealcode.com/top...
flodefacebook Merci Nicolas pour cet indicateur. Très utile dans une technique de retournement.
HeikinAshi thank you for this very interesting indicator Nicolas! did you define a tradable setup fo...
JanWd Tried the code, nice concept, seems to work quit well for US/EUR 2hrs, Other markets seems n...
JR1976 Simple and nice code , congrats !!! Seems work well with TIme frame 1 h
phanz Hi all, Sorry revisiting an old post. This algo is simple, and simplicity is the ultimate ...
christophe11560 salut gabri, Je n'ai pas de commentaire sur "s*s", c'est ton choix personnel. Je me posais...
gabri Hi, the SQRT(254) it is used to annualize the value. In terms of the "s*s" I just used the s...
christophe11560 Merci pour ton retour
guillermus69 is this " a= log(close/close[1])" better than a = ((close/close[1]) -1) *100 . I ...
gildaslm Hi gabri, thanks very much for your work, it helps me a lot. Have you ever tried to make the...
gandolfi thanks for your screener. Do you have the code for original Sharp ratio in order to compare ...
Abz Thanks gabri
Mattzi In your opinion is less than 20 stocks a bad idea? Thank you.
gabri No, you can pick as many or as little as you want. The portfolio composition depends on many...
xel Hi! I found myself that the indicator posted here contain an error, I want to edit or fix i...
Lotech123 Thanks for this indicator. Working on a 3 M timeframe with the DJI, it can produce some inte...
JSTAR PRODUCTIONS Hi there, I downloaded the Indicator but the indicator does not show up on my charts. Am...
JSTAR PRODUCTIONS Hi, Worked it out. Thanks
poonsl2828 Hi! Francesco I have test it on GBP/USD but it only have a trade on 9 Jun which i backtes...
ullle73 why not use 1h chart? has 95% hitrate
ullle73 i see most of positions are only 1 pip before exit?
Jean-Pierre Poulain When I buy and when I sell ?
Nicolas The featured image of the post do not deserve the indicator you are right, I attached other ...
Nicolas It is described in the post already :) The BUY/SELL signals are quite similar of what you ca...
Francesco78 Hi Pepmartorell, please let's continue the discussion on the forum thread so that we can sha...
Francesco78 Hi Pepmartorell, please let's continue the discussion on the forum thread so that we can sha...
Jusmih1 Hi there, i am looking at your Strategy however when you put in automatic trading mode its ...

Top