PROTECTED SOURCE SCRIPT
已更新 Same Day Price Volatility [5ema]

Indicator visualizes the price volatility of the current day alongside historical volatility patterns of the same weekday across previous weeks. It highlights high, low, and total volatility ranges with interactive boxes, labels, and average lines for easy analysis.
=====
A. How to Calculate?
*Current Day Volatility:
High Volatility: High − Open
Low Volatility: Low − Open
Total Volatility: High − Low
*Historical Volatility:
Average Lines:
Averages for high, low, and total volatility are calculated from historical values and plotted as dotted lines.
=====
B. How to Set Up?
Inputs:
=====
C. How to Use?
Analyze Current Day Volatility:
Compare Historical Patterns:
Utilize Average Volatility Lines:
Customizing Visualization:
=====
This indicator is for reference only, you need your own method and strategy.
If you have any questions, please let me know in the comments.
=====
A. How to Calculate?
*Current Day Volatility:
High Volatility: High − Open
Low Volatility: Low − Open
Total Volatility: High − Low
*Historical Volatility:
- The script scans historical data for the same weekday over the past number weeks (default: 12 weeks).
- It calculates the high, low, and total volatility for each historical same day.
Average Lines:
Averages for high, low, and total volatility are calculated from historical values and plotted as dotted lines.
=====
B. How to Set Up?
Inputs:
- Weeks Back (nb): Number of past weeks to include in historical calculations (default: 12).
- Position (pos): Horizontal offset for displaying boxes and labels (default: 50).
- Colors: Customize box colors for high, low, and total volatility ranges.
=====
C. How to Use?
Analyze Current Day Volatility:
- The script displays boxes for today's high, low, and total volatility relative to the opening price.
- Labels provide detailed tooltips for easy interpretation.
Compare Historical Patterns:
- Historical volatility boxes for the same weekday are plotted for up to number weeks.
- Labels display the exact date and volatility values for each historical day.
Utilize Average Volatility Lines:
- Use the average lines to compare today's performance against historical averages for high, low, and total volatility.
Customizing Visualization:
- Adjust the pos input to reposition the boxes and labels if overlapping with price data.
- Modify the colors to suit your preferred visual style.
=====
This indicator is for reference only, you need your own method and strategy.
If you have any questions, please let me know in the comments.
版本注释
change location some line code!版本注释
Add extend line/版本注释
update value/版本注释
add condition for bar position when inputting large number版本注释
update condition of date./版本注释
This updated version, I will make the description clearer ^^.=====
First of all, thanks to PineCoders Mods for warning me about the previous indicator description!
=====
A few updates in the new version:
- []Added a warning for timeframes different from 1D, as the indicator works only on 1D.
[]Improved some code styles.
=====
What is its purpose?
- Check Day Price Volatility for today (Fri) and the same weekday (Fri) from last week (or other weeks).
- Refer the average price line, similar to support and resistance levels.
=====
How is it calculated?
- []For the same weekday in previous weeks, I calculate volatility as (High - Open), (Low - Open), and (High - Low).
[]To display bars, I add these values to today's Open price. - For the average line, I calculate the average volatility over the weeks and add it to today's Open price.
=====
What to note?
- []The date might be slightly off for some exchanges (e.g., 1-day difference) due to timezone or pre/extended markets. But it’s mostly accurate—don’t worry ^^!
[]If you set a large number of weeks (e.g., >55, default is 12), the columns may overlap with the chart.
======
I hope this helps you better understand my indicator.
Good luck!
版本注释
updated chart!受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。