Traders who want to easily spot daily gaps (using intraday TF’s), often tweak trading times altering default settings and this may lead to unexpected issues.
This little indicator simply simulates a gap by displaying, between 22:00 and 08:00 hours, transparent candles and drawing segments from the closing hour (CLOSE price) to the next opening hour (OPEN price).
I hope it may be of some help.
// Simulates NO candles between 22:00 and 08:00, to spot gaps
//--------------------------------------------------------------
DEFPARAM CalculateOnLastBars = 1000
IF not (OpenTime >= 080000 AND OpenTime <= 220000) THEN
DRAWCANDLE(Open,High,Low,Close) COLOURED(255,255,255,255) BORDERCOLOR(255,255,255,255)
ENDIF
IF OpenTime = 220000 THEN
CloseBar = BarIndex
ClosePrice = close
ENDIF
IF OpenTime = 080000 THEN
DRAWSEGMENT(CloseBar,ClosePrice,BarIndex,ClosePrice) coloured(0,128,0,255)
DRAWSEGMENT(CloseBar,Open,BarIndex,Open) coloured(0,128,0,255)
ENDIF
RETURN
Looks to be a similar idea to this one that I wrote a while back:
Session Candles Only
Maybe I should update it to also give the option of drawing horizontal segments.