ChrisMoody

CM Gann Swing High Low V2

CM Gann Swing High Low V2

Added Improvements:
Used PineScript “linebr" code so solid lines plot only when condition = true.

Via Inputs Tab:
Ability to Turn On/Off Highlight Bars When Crossing Above/Below Swing High Low
Ability to Turn On/Off Back Ground Highlights When Crossing Above/Below Swing High Low
Ability to Turn On/Off linebr plots.

Other Features: All Available Via Inputs Tab
Ability to Adjust Moving Average Values to adjust Sensitivity.
Ability to Turn On/Off Triangles Above/Below Bars based on Indicator.
Ability to Turn On/Off Triangles at Top And Bottom Of Screen Showing Direction of Indicator.

***Basically you have Option to View Indicator about every way possible.

***Special Thanks to Glaz for Original Code.

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
//Updated on 10-6-2015 By ChrisMoody
//Added Linebr ability, ability to turn on/off highlight Bars when crossing Swing Hi/Lo
//Added Ability to turn on/off background highlight when bars cross swing hi/lo
//Created 99% by Glaz and ChrisMoody Modified about 1% on 7/30/2014 for user dvk197-

study(title="CM_Gann Swing HighLow V2", shorttitle="CM_Gann_Swing_HL_V2", overlay=true)
periods=input(3, minval=1, title="Moving Average Period")
pt = input(false, title="Plot Up/Down Triangles at Top and Bottom of Candles/Bars?")
pc = input(true, title="Plot Circles at Top and Bottom of Candles/Bars?")
pttb = input(true, title="Plot Triangles at Top and Bottom of Screen?")
shb = input(false, title="Show Highlight Bars on Cross Up or Cross Down?")
sbh = input(true, title="Show Background Highlights at Cross Up or Cross Down?")

//code for Calculations
hld = iff(close > sma(high,periods)[1], 1, iff(close<sma(low,periods)[1],-1, 0))
hlv = valuewhen(hld != 0, hld, 1)

//code for Plot Statements
hi = hlv == -1 ? sma(high, periods) : na
lo = hlv == 1 ? sma(low,periods) : na

//Rules for coloring Background highlights & Highlight Bars
closeAbove() => shb and close > hi and close[1] < hi
BHcloseAbove = sbh and close > hi and close[1] < hi
closeBelow() => shb and close < lo and close[1] > lo
BHcloseBelow = sbh and close < lo and close[1] > lo

//Highlight Bar Color Plots
barcolor(closeAbove() ? yellow : na)
barcolor(closeBelow() ? yellow : na)
//Background Highlight Rules
bgcolor(BHcloseAbove ? green : na, transp=60)
bgcolor(BHcloseBelow ? red : na, transp=60)

//Plot Statements for circles and Triangle Up/Down at Price Bars
plot(pc and hi ? hi : na,title="Gann Swing High Plots-Circles", color=fuchsia,style=linebr, linewidth=4)
plot(pc and lo ? lo : na,title="Gann Swing Low Plots-Circles", color=lime,style=linebr, linewidth=4)
plotshape(pt and hi ? hi : na,title="Gann Swing High Plots-Triangle Down", offset=0, style=shape.triangledown, location=location.abovebar, color=fuchsia, transp=0)
plotshape(pt and lo ? lo : na,title="Gann Swing Low Plots-Triangle Up", offset=0, style=shape.triangleup, location=location.belowbar, color=lime, transp=0)

//Plot Statement for Triangles at Top and Bottom of Screen
plotshape(pttb and hi ? hi : na,title="Gann Swing High Plots-Triangles Down Top of Screen", offset=0, style=shape.triangledown, location=location.top, color=red, transp=0)
plotshape(pttb and lo ? lo : na, title="Gann Swing Low Plots-Triangles Up Bottom of Screen",offset=0, style=shape.triangleup, location=location.bottom, color=lime, transp=0)