To collect stats on the hourly occurrences of HoD and LoD in an asset, to see which times of day price is more likely to form its highest and lowest prices.
//How it works:
Each day, HoD and LoD are calculated and placed in hourly 'buckets' from 0-23. Frequencies and Percentages are then calculated and printed/tabulated based on the full asset history available.
-Timezone (default is New York); important to make sure this matches your chart's timezone
-Day start time: (default is Tradingview's standard). Toggle Custom input box to input your own custom day start time.
-Show/hide day-start vertical lines; show/hide previous day's 'HoD hour' label (default toggled on). To be used as visual aid for setting up & verifying timezone settings are correct and table is populating correctly).
-Use historical start date (default toggled off): Use this along with bar-replay to backtest specific periods in price (i.e. consolidated vs trending, dull vs volatile).
-Standard formatting options (text color/size, table position, etc).
-Option to show ONLY on hourly chart (default toggled off): since this indicator is of most use by far on the hourly chart (most history, max precision).
// Notes & Tips:
-Make sure Timezone settings match (input setting & chart timezone).
-Play around with custom input day start time. Choose a 'dead' time (overnight) so as to ensure stats are their most meaningful (if you set a day start time when price is likely to be volatile or trending, you may get a biased / misleadingly high readout for the start-of-day/ end-of-day hour, due to price's tendency for continuation through that time.
-If you find a time of day with significantly higher % and it falls either side of your day start time. Try adjusting day start time to 'isolate' this reading and thereby filter out potential 'continuation bias' from the stats.
-Custom input start hour may not match to your chart at first, but this is not a concern: simply increment/decrement your input until you get the desired start time line on the chart; assuming your timezone settings for chart and indicator are matching, all will then work properly as designed.
-Use the the lines and labels along with bar-replay to verify HoD/LoD hours are printing correctly and table is populating correctly.
-Hour 'buckets' represent the start of said hour. i.e. hour 14 would be populated if HoD or LoD formed between 14:00 and 15:00.
-Combined % is simply the average of HoD % and LoD %. So it is the % likelihood of 'extreme of day' occurring in that hour.
-Best results from using this on Hourly charts (sub-hourly => less history; above hourly => less precision).
-Note that lower tier Tradingview subscriptions will get less data history. Premium acounts get 20k bars history => circa 900 days history on hourly chart for ES1!
-Works nicely on Btc/Usd too: any 24hr assets this will give meaningful data (whereas some commodities, such as Lean Hogs which only trade 5hrs in a day, will yield less meaningful data).
Example usage on S&P (ES1! 1hr chart): manual day start time of 11pm; New York timezone; Visual aid lines and labels toggled on. HoD LoD hour timings with 920 days history:
~ Working only with TradingView default new day start times (i.e. this feature will not apply when 'use custom input day start hour' is toggled on).
--Other updates & notes:
~Fixed label position error in High of day label
~Added Low of day label option
~Fixed Friday data fill error on traditional assets
~Please note that bank holiday early-close sessions may cause minor data skew for traditional assets.
Demo of Specific Day of week selection usage & display timezone input:
ETH erc20: 0x4b0400B1c18503529ab69611e82a934DDe4Ab038
ETH bep20: 0x1F0f03F184079bb1085F8C9dF3a8191C9f5869B3
Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.