OPEN-SOURCE SCRIPT
已更新 RTH Gaps and Expected Move

Daily Expected Move (Rule of 16) + RTH Gaps
Two things worth knowing at the cash open: how far the day is likely to travel, and what unfilled space the overnight session left behind.
Expected move
The script divides the volatility index by sqrt(252) ≈ 16 to turn annualised implied volatility into a one-day standard deviation, then draws 0.5σ, 1σ, 2σ and 3σ around the previous RTH close (session open optional). Levels are fixed at the open and cannot repaint; the index value used is the previous session's last value. The index follows the symbol: VXN for Nasdaq, RVX for Russell, VXD for Dow, VIX otherwise, or set your own. Past sessions can be kept on the chart for backtesting; each old line stops at the last bar of its session.
RTH gaps
At each session open the script boxes the distance between that open and the previous RTH close. As price trades into a gap the box shrinks from the current bar onward while the part to the left keeps its original height, so the gap leaves a staircase showing how large it was at every bar. The box is deleted once price crosses it fully.
Table
The current session's levels, highest to lowest, with the last price slotted between the level above and below it, and the distance to each in points, ticks or percent.
Use it on an intraday chart set to regular trading hours
It runs on 24-hour charts too, but there the overnight bars mitigate the gaps, so a gap can be marked filled by a thin 3 a.m. move. Daily charts and higher are not supported.
Originality
Gap boxes and expected-move levels exist separately elsewhere. Here the gap boxes keep their history instead of erasing it, and both features share one anchor (the previous RTH close) so a gap can be read against the expected move directly.
Limitations
Gaps are only measured at session boundaries; set the session input to match your instrument. The expected move assumes normally distributed returns, so real tails are fatter than ±3σ suggests. TradingView allows 500 boxes, lines and labels per scrip; the three maximum inputs exist for that reason, and raising them past the budget makes the oldest drawings vanish silently. No levels are drawn if the volatility index has no data.
Two things worth knowing at the cash open: how far the day is likely to travel, and what unfilled space the overnight session left behind.
Expected move
The script divides the volatility index by sqrt(252) ≈ 16 to turn annualised implied volatility into a one-day standard deviation, then draws 0.5σ, 1σ, 2σ and 3σ around the previous RTH close (session open optional). Levels are fixed at the open and cannot repaint; the index value used is the previous session's last value. The index follows the symbol: VXN for Nasdaq, RVX for Russell, VXD for Dow, VIX otherwise, or set your own. Past sessions can be kept on the chart for backtesting; each old line stops at the last bar of its session.
RTH gaps
At each session open the script boxes the distance between that open and the previous RTH close. As price trades into a gap the box shrinks from the current bar onward while the part to the left keeps its original height, so the gap leaves a staircase showing how large it was at every bar. The box is deleted once price crosses it fully.
Table
The current session's levels, highest to lowest, with the last price slotted between the level above and below it, and the distance to each in points, ticks or percent.
Use it on an intraday chart set to regular trading hours
It runs on 24-hour charts too, but there the overnight bars mitigate the gaps, so a gap can be marked filled by a thin 3 a.m. move. Daily charts and higher are not supported.
Originality
Gap boxes and expected-move levels exist separately elsewhere. Here the gap boxes keep their history instead of erasing it, and both features share one anchor (the previous RTH close) so a gap can be read against the expected move directly.
Limitations
Gaps are only measured at session boundaries; set the session input to match your instrument. The expected move assumes normally distributed returns, so real tails are fatter than ±3σ suggests. TradingView allows 500 boxes, lines and labels per scrip; the three maximum inputs exist for that reason, and raising them past the budget makes the oldest drawings vanish silently. No levels are drawn if the volatility index has no data.
版本注释
Added "Show current price location" to the sigma table. The table keeps a row for the last price between the level above and the level below it.
The table shows the levels only.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。