ChrisMoody

CM Gann Swing High Low V2

37114 views
7001
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.
Remove from Favorite Scripts Add to Favorite Scripts
//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)

Comments

This has been implemented as a STUDY which gives the graphs/lines/indicators.
How would this be changed into a STRATEGY so it could produce the Strategy Tester results?

I am new to PineScript and trying to learn as much as possible to get into the "useful" category.
+9 Reply
Gann Swing High Low is a great indicator. Especially for new traders. I have used this tool effectively on a different platform and it is extremely useful through its simplicity. I would like to offer a suggestion for those who may put this tool to use. It may be obvious to some but maybe not so much to others..... Add two more of the same indicator to the price chart for a Multi-Time Frame view makes the Signals which break in conjunction with other periods very strong. Example for Daily chart use three Gann Swing High Low indicators with 30, 90, 120 for your periods. Also, when the indicator with the shortest period breaks, use the medium and longer period indicators as targets as price will respect their respective values and usually bounces off of them. Another effective use is to use horizontal markers (horizontal lines marking price) where the indicator "switches" to mark the breaks. Use the price OPEN for exact marker level. These levels will prove very very useful as Support/Resistance in the future. ESPECIALLY if the short and medium period breaks occur at the same time. That would be a clear indication of a very important price level to watch price action bias. Hope this helps.
+8 Reply
ChrisMoody cooney_s
Excellent input...Thanks. Question for you.

Would a traditional GANN Follower typically use certain settings? Or would you say it's more like traders who use moving averages...meaning a short term trader might use a 8 and 13 EMA while a long term trader might use a 50 and 200 SMA?

Just interested in you perspective since you've used the indicator before.
+1 Reply
cooney_s ChrisMoody
Great question. The easiest reply would be to apply it as a trader would use moving averages. And I would highly recommend periods 13, 21, 55, 89. Traders preference of any two. I find 13 and 55 extremely useful for most instruments. This is where the most action takes place. Eliminates the noise on the front and the backsides of entries/exits.

Reply
How can I use this indicator? Could you please give me access for this. @ChrisMoody
+6 Reply
Chris, read the whole blog on this. I like the clarity it offers...very good & thanks!
+5 Reply
great indicator especially when the indicator occurs over multi timeframe(s). Any chance of creating an alert when the indicator crosses , especially if this can be done over multiple timeframe?
+4 Reply
Also, another trick I have learned to do that works especially well with the Trading View platform involves using the Renko bar. Start with a standard price chart and add the CM Gann Swing High Low indicator. Change the price chart view to Renko ((one click to the right of the traditional price bar view in the TV tool bar)). Now mark the break points of the indicator at the CLOSE of the highlighted candle. I like to use the Horizontal Ray tool in this methodology. The reason why will present itself in a the next step. Now switch back to the traditional price bar view and you will see how useful this really is!!! Thought I would share a very effective method of using Trading View tools.
+4 Reply
timwest cooney_s
Feel free to post some charts on it - and thanks for sharing.
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 Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out