TradingView
vnhilton
11 lug 2022 20:44

ADR + IDR [vnhilton] 

Bitcoin / TetherUSBinance

Descrizione

Average Day Range (ADR) is an indicator that calculates the average range of high to low of the candles for a set period of time. This is more useful for intraday trading, where, on an average day, you'd expect price to trade in a range similar to the ADR. This indicator also includes an Intraday Day Range (IDR), which can be used to track progress of the intraday range. By default, IDR is in multiplier form i.e. if it's 2, then the day has traded at a range twice as large as the ADR (you have the option to change IDR to price form if you wish). Therefore, IDR can also be used to measure intraday volatility (as well as taking profit & perhaps fading false breakouts when IDR is at 1x, 1.5x, 2x, etc.) by seeing if today is above/below/at average. This means that this indicator is intended for intraday use, but can be used up to the daily timeframe.

(ADR & IDR values can be seen in the top left)

The indicator also plots intraday high & low levels so when price trades near these levels then the indicator can become of use (if price trades far away from these levels, then you don't need to pay any attention to the indicator).

We can see in the chart snapshot image above for BTCUSDT, its 10 period ADR is 1149.37, & IDR is 0.52 (just over 50% of the ADR) as of 21:40 BST, meaning that BTCUSDT price range today is lower than average.

You may notice that the intraday high & low isn't touching the intraday high & low lines respectively on instruments that isn't cryptocurrencies nor forex pairs. To solve this problem, you would have to get extra market data from TradingView, or to integrate your broker with TradingView to pass along your broker's data feed (provided your broker also has real-time data - if not you may need to get extra market data via the broker.

Note di rilascio

- Added 25%,50%,75% lines in-between intraday high & low. To set custom percentages, modify the percentage value in the code (Note the percentage distance starts from the intraday low up).
Commenti
cresaniss
Hello, I was backtesting this indicator and it seems to perfectly predict the highs and lows every single day. Can it predict future price action accurately or is it accurate because of past data?
vnhilton
@cresaniss, Hello cresaniss. There must be a flaw in your backtesting, of your fault or TradingView's (as TV backtesting is notorious for being bad). There's an assumption we're making here that on an average day, the ticker's intraday day range (IDR) would move ~1x its average day range (ADR). It's almost impossible for a ticker to just have an average day every single day, as there'll be days that drive significant interest due to significant catalysts or technical setups, so if you're creating a mean reversion system where you start a long/short position as a ticker hits 1x its ADR via lows/highs you need to be aware of this. Same for covering positions in a trend following system, as the IDR can be multiplies of the ADR. Please note that on an average day, its IDR will not exactly be 1x its ADR, there will be variance. Hope this helps.
Nurulamin572
Kindly add option to lines as solid instead dotted(adjustable).
vnhilton
@Nurulamin572, this code was terribly written as it displays prices instead of plotting actual lines on the chart. I can rewrite this code in the future if I have time. In the meantime, you could look into my remaining ATR indicator, and edit it to use ADR instead of ATR, and only display the HOD and LOD. I will reply to you again once I've updated this specific indicator.
Nurulamin572
@vnhilton, Appreciated your effort for offering a free script to make better the trading community.
Incase you are sparing time to create a script I will suggest you to create a script which mark low of the day and high of the day as soon market opens with historical records of performance.
I'm available all the time to work on it with you offering concept.
vnhilton
@Nurulamin572, could you please elaborate on "historical records of performance"?
Nurulamin572
@vnhilton, sure indicator should show past trading days plotting of day low and day high(not only today) and it should be adjestive depending on user's need past 1,2,3,4,5...x days so user can easily backtest.
And defined day low / high should not be repainted.
vnhilton
@Nurulamin572, I think such an indicator you're describing already exists in the public library, maybe even with the range statistic, but probably not with the ADR stat, though should be easily incorporated with snippet of the code present in this indicator.
Nurulamin572
@vnhilton, what ever I found was repainted. Let me explain exactly our goal...
*From opening of market very first second it should plot the day range low and high.
* the marked support and resistance must remain fixed for whole trading session.
* in uptrend once price touch the support it has to be the day support and price keep on travel to the defined day resistance.
* price must not make new low during that trading session.
vnhilton
@Nurulamin572, should it not repaint as price makes new highs/lows of day? If it doesn't repaint, then the HOD/LOD levels would be stuck at the prices 1 second after the market open, or maybe I'm misunderstanding...
Altro