MTF Adaptive ATR

v10.3
MTF Adaptive ATR

True Multi-Timeframe Dynamically Adapting ATR

This is actually a major overall to an earlier indicator I submitted to the library. The idea behind this indicator is to provide us with an Average True Range indicator than instead of the standard ATR indicator which is calculated with a static look back period, rather give us an ATR indicator that will only look at the most relevant price data. This means the indicator will (depending on the timeframe selected) only consider either market hours, after market hours or current weekly data. In this way, the sampled price data will always be relevant. The look-back period used to calculate the ATR will thus dynamically adapt as the trading day or week progress.

Explanation of the parameters:

  • TFMinutes: This parameter is used to input the current timeframe in minutes. (So for 5m TF set the parameter to 5, for hourly set it to 60)
  • TFMultiplier1: Those too lazy to work out higher timeframes you can use the multipliers. (Hourly TF is: TFMinutes = 1 and TFMultiplier1 = 60)
  • TFMultiplier2: Extention to the above functionality. (4-Hour TF is: TFMinutes = 1, TFMultiplier1 = 60 and TFMultiplier2 = 4)
  • stdDev: Standard deviation used to calculate the Relative ATR line
  • RecentDataPer: What percentage of the lookback period to sample for the SampledATR calculation (Recent Data)
  • MiddleDataPer:  What percentage of the lookback period to sample for the SampledATR calculation (Middle Data)
  • EarlyDataPer: What percentage of the lookback period to sample for the SampledATR calculation (Early Data)
  • ShowCalculationPeriod: Can be enabled to show a line on the indicator with the lookback period used for calculations
  • UseCloseOpenvsHighLow: If enabled will use open and close values instead of high and low to calculate the Total Price Range
  • GMTOffset: This is used to offset the GMT time difference in the code. (Default is set to GMT+2)
  • MarketOpenHour: Enter the hour (24hr) in which the market opens
  • MarketCloseHour: Enter the hour (24hr) in which the market closes
  • EnableAfterHours: Enable to calculate ATR values for after hours

Indicator Output Explained:

  • The black histogram shows the total price range for the evaluated period (be that for in-market hours, after-market hours or current weekly data)
  • The pink line called ‘Relative ATR’ shows the standard deviation adjusted ATR value based on the evaluation period
  • The green line called ‘Sampled ATR’  shows the averaged ATR as sampled over the 3 different data sets (within the evaluation period)

Possible Interpretations:

  1. When the black histogram expands it signifies that price is breaking higher or lower and expanding the current trading range.
  2. When the black histogram increases in steps without remaining static for extended periods we can assume the market is trending
  3. When the black histogram remains static we can assume the market is consolidating or ranging (watch for expansion)
  4. When the pink line rises with the green line we can assume that volatility is increasing
  5. When the pink line falls with the green line we can assume that volatility is decreasing
  6. When the pink line and the green line diverge we can assume a possible direction change is probable
  7. When either the pink line or the green line extends above the histogram it implies current volatility is extreme
  8. When the pink line stays high relative to the histogram it implies market is choppy with no clear direction
  9. When the pink line  stays low relative to the histogram it implies the market has a lot of momentum and trending

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

avatar
Register or

Likes

avatar avatar avatar
Related users ' posts
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 ...
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...

Top