Opening Range Gaps [TFO]

This indicator displays Opening Range Gaps with an adjustable time window. Its intention is to capture the discrepancy between the close price of previous and new Real Trading Hours (RTH) sessions, i.e. yesterday's close compared to today's open. A gap will be drawn from this area with a solid line denoting its midpoint, and dashed lines denoting the upper and lower quartiles of its range. Its color is determined by whether the new session open price is above or below the previous session close.

The Gap Session parameter allows users to define the specific time window for which to capture the "gap" in price. Using U.S. index futures as an example, we can use 16:00 - 09:30 (EST) to capture the discrepancy between the previous day's close price and the current day's open price. However, this parameter is left as adjustable for users that may want to observe different markets or simply experiment with different time windows.

Show Session Delineations will draw vertical timestamps denoting the start and end times of the provided Gap Session. Track Start Price serves as a visual aid to track the initial price of the Gap Session until its end price is validated, for easy visual verification of a gap's upper and lower bounds. With both options turned off, the indicator will only display the gap boxes and lines, as shown here:

Extend Boxes will draw all gaps with an indefinite extension to the right. This can get messy with a large number of boxes, which is why we have a Keep Last parameter to limit how many sessions' drawings should be stored. Any drawings that were made beyond this number of sessions in the past will automatically be deleted.

The Timeframe Limit will dictate that the indicator as a whole will only draw objects on timeframes less than or equal to this timeframe, determined by the user. In some cases this may help users avoid resolution errors which may arise from using timeframes that are too large for a given session. For example, if a user wanted to track a Gap Session of 16:15-09:30, the Timeframe Limit should be set to 15 minutes because the close price at 16:15 cannot be observed on a 30 minute chart (or greater).


本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。