TradingView
twingall
23 févr. 2023 03:06

Regular vs Electronic Trading hours Gap (RTH vs ETH); 4pm-9:30am 

E-mini S&P 500 FuturesCME

Description

-Shows the gap between 4pm close and 9:30am open; the Regular trading hours Vs Electronic trading hours Gap (RTH vs ETH).
-Displays this as a box starting at 9:30am, whose bottom is the 9:30am open; top is previous day's 4pm close.
-Displays when chart is toggled to either of ETH or RTH.
-Useful reminder of area above/below opening bell price that price often has a tendency to want to fill in, partially or fully
--(all times here refer to America/New_York timezone)

//Options:
~Number of past boxes to show
~Extend boxes fully to the right
~Box background color, border color, and opacities

//Limitations:
-works only on timeframes 30mins or lower (works on 1,2,5,10,15,30minutes)
-will not work on non-typical low timeframes (like 4min or 7min) since they are not divisible into 30

Notes de version

-Added 4pm close line (extends into next day's close), to anticipate the far side of the RTH gap before the opening bell at 9:30am
-Note this will not work properly on Holiday sessions (like this monday 21st Feb) when there is no 4pm close

Notes de version

-Added price label option for 4pm lines
-Added box text label option

Notes de version

-update cover chart

Notes de version

-Updated to be versatile across ES, SPX, SPY(whether on RTH chart or ETH chart).
-Fixed small error in timing

Notes de version

(fixed typos)

Notes de version

-lines & labels formatting; update description comments

Notes de version

-Added time offset (in minutes, 5minute steps) for non-USA based Indices traders. Default is zero, but for example you might set each of the two offsets to '-300' for a London based index.
-Make sure offset minutes are divisible into the chart's timeframe or it will not plot.

Notes de version

-Added High-Low gap: for the gap between last RTH bar high/low and first RTH bar low/high (4:15pm - 9:30am NY time).
-Added color/formatting options.
-Thanks to @Ryazn for the idea of adding these High/Low gaps, and demonstrating to me their especial sensitivity to price.

Notes de version

-added optional midlines for both RTH regular gap and HiLo gap (default toggled OFF)

Notes de version

-Changed function of 'extend right': toggling this on now brings all displayed boxes & midlines up to the last bar index
-Added box/midline text showing the day the gap was 'formed' (i.e '>>Thurs' is the gap between Weds and Thursday Regular trading hours) and the price value of the midline.
-All boxes & lines text can be independently toggled on/off.
Example: 5min ES1! chart on electronic trading hours, plotting 5 historical HiLo Gap boxes with midlines; all extended to the right; all text showing. Price reacting off the previous Thursday Gap midline:

Notes de version

-added 'no plot session' for use when 'extend boxes & midlines right' or 'extend lines right' are toggled on. Stops boxes/ lines painting within the input session (i.e. outside of your trading hours). Default is toggled off. Timezone is "America/New_York"; check the timing of session by uncommenting line 38 (bgcolor).

Notes de version

-fixed issue in code which caused lag in box painting right hand side in realtime

Notes de version

-update default settings

Notes de version

-updated RTH standard gap box to run from 4:15pm - 9:30am (on SPY 4pm - 9:30am) to reflect the timings of the actual last bar of RTH trading on ES.
-For SPY: where RTH finish earlier (4pm), updated HiLo gap (the high/low at 4pm to the high/low of the 9:30am first candle candle of new RTH day)

Notes de version

-Update cover chart image
Commentaires
Liquidity_Pro
I like this indicator a lot but it doesn't work on some of my favorite time frames, 7m, 8m, 9m, 11m,12m, 13m, and 14m charts neither in ETH or RTH. Would love to have a fix...
twingall
@upsidesignal, On non-typical timeframes where 9:30 and 4pm don't mark candle open/close times, it won't work. You could use the offset minutes inputs to make custom gap: i.e. for 7min timeframe, offset +1 and offset +3 (for the 16:03 to 9:31 gap)
Liquidity_Pro
@twingall, many thanks!!
Liquidity_Pro
@twingall, i got the 7 and 9 working but couldn't figure out 8 or 11... this is what i did:
if chartTFInMinutes == 7
openOffset := 1
closeOffset := 3
else
if chartTFInMinutes == 9
openOffset := -3
closeOffset := 3
else
openOffset := 0
closeOffset := 0
twingall
@upsidesignal, sent you a dm
HPhatPatH
Hey I noticed that when I have "extend boxes and lines to the right" it will go up to the most current candle, but as the candles keep progressing, it doesn't progress with it in real time? Is there a way to fix this?
twingall
@HPhatPatH, Just fixed. Remove and re-add the indicator. Let me know if any problems with it
HPhatPatH
@twingall, looks like it's working now! Thanks!
chezarecurrybooks
Why can't I find the option to change this? Was it removed from the basic plan?
MiketheBarbarian
Amazing indicator. Please add an extend box until X time option. I typically have a trading window for myself from 9:30 to 2pm. I'd love to have the box stop extending after 2pm to reduce chart clutter overall.
Plus