Updated Intra-Day Gap Indicator.

Version 2.1…Many Additional Features To Come.

***Designed for Intra-Day Charts.
***Great for Stocks…Forex and Futures Sunday Night Gaps.

***Plots Green Lines If Gap Up (See Added Features Below)
***Plots Red Lines If Gap Down

MAJOR Feature Added:
***Added Check Boxes In Inputs Tab That Let’s You Choose if You Want To See All Gaps, Or Only Gaps That Open Above/Below Previous Days High/Low

Other Features Added:
***Gap Mid Lines
***Color Fill Based On Gap Up Or Down

Additional Features Coming!!!
Remove from Favorite Scripts Add to Favorite Scripts
//Created By ChrisMoody on 1-15-2015
//Version 2...added ability to Choose if Gap Up or Down Plots based on Open Being Above/Below Close OR Open Being Above/Below Previous Days High/Low
//Added Shading based on Gap Up or Down

study(title="CM_Gap_Indicator_Intra-Day_V2.1", shorttitle="CM_Gaps_Intra-Day_V2.1", overlay=true)

guc = input(true, title="Gap Up Criteria - IF CHECKED = Open is > Than Previous Days CLOSE, If NOT CHECKED = Open is > than Previous Days HIGH")
gdc = input(true, title="Gap Down Criteria - IF CHECKED = Open is < Than Previous Days CLOSE, If NOT CHECKED = Open is < than Previous Days LOW")

//Criteria using Daily Sessions
tdo = security(tickerid, 'D', open)
pdc = security(tickerid, 'D', close[1])
pdh = security(tickerid, 'D', high[1])
pdl = security(tickerid, 'D', low[1])

midLine = abs((pdc + tdo)*.5)

gapUpPct = guc and tdo > pdc ? tdo > pdc : tdo > pdh

plotGapUpLine = gapUpPct == 1 ? tdo : na
plotGapUpLowLine = gapUpPct == 1 ? pdc : na
plotGapUpMidLine = gapUpPct == 1 ? midLine : na

gapDnPct = gdc and tdo < pdc ? tdo < pdc : tdo < pdl

plotGapDnLine = gapDnPct == 1 ? tdo : na
plotGapDnUpLine = gapDnPct == 1  ? pdc : na
plotGapDnMidLine = gapDnPct == 1 ? midLine : na

p1 = plot(plotGapUpLine, title="Gap Up - Upper Gap Line, Todays Open", style=circles, linewidth=3, color=lime)
p2 = plot(plotGapUpLowLine, title="Gap Up - Lower Gap Line, Yesterdays Close", style=circles, linewidth=3, color=lime)
plot(plotGapUpMidLine, title="Gap Up - Mid Line", style=circles, linewidth=2, color=gray)
fill(p1, p2, color=green, transp=70)

p3 = plot(plotGapDnLine, title="Gap Down - Lower Gap Line, Todays Open", style=circles, linewidth=3, color=red)
p4 = plot(plotGapDnUpLine, title="Gap Down - Upper Gap Line, Yesterdays Close", style=circles, linewidth=3, color=red)
plot(plotGapDnMidLine,  title="Gap Down - Mid Line", style=circles, linewidth=2, color=gray )
fill(p3, p4, color=red, transp=85)


Hi Chris,

how to use this script at mt4 platform?
+11 Reply
Anyone found an indicator for spotting gaps on lower time frames ?
+3 Reply
greywolf254 jordanovitch
@jordanovitch, yes you can. You can use this.

resCustom = input(title="Use Different Timeframe", defval="D")

tdo = security(tickerid, resCustom, open)
pdc = security(tickerid, resCustom, close)
pdh = security(tickerid, resCustom, high)
pdl = security(tickerid, resCustom, low)
+5 Reply
bipla jordanovitch
Very interesting! How do you setup an alert on it to be advised each time a gap occurs?
+1 Reply
TY Chris for coding this!
No Problem...more features to come soon
+8 Reply
AllexMaddda ChrisMoody
Would this work on 1h chart ?
+9 Reply
nilanjan62 ChrisMoody
@ChrisMoody, can you pls explain how to use this
+1 Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out