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

Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?
//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)