ChrisMoody

CM_Gap_Indicator_Intra-Day_V2.1

CM_Gap_Indicator_Intra-Day_V2.1

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!!!

开源脚本

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

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//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)