Higher Time Frame Fair Value Gap [ZeroHeroTrading]A fair value gap (FVG) highlights an imbalance area between market participants, and has become popular for technical analysis among price action traders.
A bullish (respectively bearish) fair value gap appears in a triple-candle pattern when there is a large candle whose previous candle’s high (respectively low) and subsequent candle’s low (respectively high) do not fully overlap the large candle. The space between these wicks is known as the fair value gap.
The following script aims at identifying higher timeframe FVG's within a lower timeframe chart. As such, it offers a unique perspective on the formation of FVG's by combining the multiple timeframe data points in the same context.
You can change the indicator settings as you see fit to achieve the best results for your use case.
Features
It draws higher timeframe bullish and bearish FVG's on the chart.
For bullish (respectively bearish) higher timeframe FVG's, it adds the buying (respectively selling) pressure as a percentage ratio of the up (respectively down) volume of the second higher timeframe bar out of the total up (respectively down) volume of the first two higher timeframe bars.
It adds a right extended trendline from the most recent lowest low (respectively highest high) to the top (respectively bottom) of the higher timeframe bullish (respectively bearish) FVG.
It detects and displays higher timeframe FVG's as early as one starts forming.
It detects and displays lower timeframe (i.e. chart's timeframe) FVG's upon confirmation.
It allows for skipping inside first bars when evaluating FVG's.
It allows for dismissing higher timeframe FVG's if there is no update for any period of the chart's timeframe. For instance, this can occur at lower timeframes during low trading activity periods such as extended hours.
Settings
Higher Time Frame FVG dropdown: Selects the higher timeframe to run the FVG detection on. Default is 15 minutes. It must be higher than, and a multiple of, the chart's timeframe.
Higher Time Frame FVG color select: Selects the color of the text to display for higher timeframe FVG's. Default is black.
Show Trend Line checkbox: Turns on/off trendline display. Default is on.
Show Lower Time Frame FVG checkbox: Turns on/off lower timeframe (i.e. chart's timeframe) FVG detection. Default is on.
Show Lower Time Frame FVG color select: Selects the color of the border for lower timeframe (i.e. chart's timeframe) FVG's. Default is white.
Include Inside Bars checkbox: Turns on/off the inclusion of inside first bars when evaluating FVG's. Default is on.
With Consistent Updates checkbox: Turns on/off consistent updates requirement. Default is on.
Higher-timeframe
Papercuts Time Sampled Higher Timeframe EMA Without SecurityThis EMA uses a higher time sampled method instead of using security to gather higher timeframe data.
Its quite fast and worked well with the timeframes prescribed, up to 8hrs, after 8hrs, the formatting gets more complicated and i probably wouldn't use it anyway.
You can use this as a guide to avoid security and even f_security with this method.
NOTE: This includes the non repainting f_security call so that i woudl be able to check my results against what it does, thats not nessecary to keep at all.
There is some minor differences in data, but its so minor it doesnt bother me, though it would be interesting to know what the difference actually is. If anyone figures that out, leave a comment and let me know!
This is meant to be an example for others to build and learn and play with.. so enjoy!
HTF High/LowThis simple script draws the previous higher timeframe candle high/low to your chart.
You can also make the script paint the zone between the low/open and the high/close.
Higher Timeframe EMAThis script plots a higher timeframe EMA to your chart.
You can specify the timeframe and the length of the EMA in the settings.
This chart demonstrates the 5-minute 50EMA (black) combined with the 1-hour 50EMA (colored) on the 1 minute timeframe.