CM Gann Swing High Low V2

11998 27 1958
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,, 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)
Great stuff thanks!
Thank You
Thanks Chris, love your work, going to try it out now.
By the way...I created this by I haven't evaluated it as I normally would...but the chart posted used a setting of 5 vs. the 3 which is default. So play around with the setting depending on instruments you trade
+1 Reply
check out analysis on
I thought it was very helpful.
Love the line breaks pinescript. Maybe you can see if the line before is true, then paint it again... Until it is false and get the background to be entirely one color - either red or green in this example.
+1 Reply
Background Highlighting is no problem. Will add in next version.

Excellent analyze posted on main page link...his analysis would be more your trading style...
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.
+4 Reply
ChrisMoody PRO coondawg71
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
coondawg71 PRO 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.

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.
+3 Reply
timwest PRO coondawg71
Feel free to post some charts on it - and thanks for sharing.
littleriver coondawg71
Is this a good example?
coondawg71 PRO littleriver
Here, using the same instrument with same settings I made some notations that should help understand what to do with the Gann Swing HL V2 indicator while in Renko bar mode. After these elements are added, switch back to traditional price chart. I used yellow markers for Sell and Sky Blue for Buy. There is one special notation indicating an overlap of a Buy and a Sell signal offered by the indicator bar highlighter option that creates basically a reliable Supply and Demand line. Plus there is an additional single red marker placed at a Renko bar trend change. The use of this is seen when price is switched back to traditional price chart mode. When traders see the element of disparity between Renko and Traditional perhaps it will assist in understanding how a traditional price chart is just raw data. We need to be able to extrapolate the data, smooth the data, so it is legible and therefore more easily interpreted. Raw price data is not on a singular plane (horizontal). Raw price data is always revolving/rotating/vortexing around an axis. That axis changes its orientation to vertical much like a spinning top...but always rotating! Renko helps us by putting price back on a singular plane to which we can apply our drawing tools or oscillators in a more trustworthy/reliable fashion. Fortunately, Trading View makes this relationship easy to see.
+1 Reply
coondawg71 PRO coondawg71
+1 Reply
coondawg71 PRO coondawg71
Here, we have switched back to the traditional price chart. In this follow up I thought it would be more prudent to be consistent with the Buy and Sell signals generated by Gann Swing trend changes by using the same color Vertical markers (sky blue for Buy and yellow for Sell). After switching back to a traditional chart we see the manually placed Vertical markers (same colors but dashed line) in conjunction with the Gann Swing highlighted markers which are now working with the raw data price. I must make mention that after the switch back to traditional chart I need a Resistance point for the raw data to run up against due to the fact I neglected to mark the Tops of the Renko trend changes. It was apparent it was necessary to plot as we switch back to traditional it was this exact level that started on September 3, 2014 where the bearish price trend began after hitting the resistance the Renko marker plotted. Gann Swing confirmed bearish behavior with a signal to sell on September 11 from the raw data and then a Renko sell signal added even more weight to the price action with a sell signal marker on September 18. Price for this instrument crashed through what I would classify as Target 1 @ $16.87 and then Target 2 @ $12.33 and finally it found support @ $11.18 with the Horizontal marker plotted that was plotted on the bottom of trend change while in the Renko bar mode!!! Currently price is trapped between the yellow marker above and the red marker below. Very interesting time for this instrument to say the least and a great example of how I used this methodology for Technical Analysis using the CM Gann Swing High Low V2 indicator. I could go on, but I will leave it at that for now. Enjoy.
+1 Reply
littleriver coondawg71
Thank you coondawg71 for the information, explanation and chart! This is a very interesting level and your renko method for finding hidden levels adds to it . Here is the chart with your renko hidden levels of support displayed with Fib Ret, Gann Fan, and Lazy Bear version of Tim W hidden earning levels. Of theses, your renko is the most pinpoint so far. Thanks again!!
coondawg71 PRO littleriver
Yes, very interesting time for this instrument indeed. Looks like it is actively traded and can offer nice price action. If you wanted some additional insight, perhaps you could add one shorter period Gann Swing with a period of 8 and a longer period of 34 or 55. Always good numbers to use, 21 is another but since you had 19 plotted already I figured you could use than as your Median average, especially since we have conducted a pretty good amount of analysis involving that figure. See if the short period has offered something useful beside noise. Plus, keep in mind when we plot 3 different periods, price tends to respect their moving average values and can be used as Targets/Stops=Support/Resistance. Price being in a pretty good down swing is searching for support, we can discover where that is by using the longer period Gann Swing. Price is showing it is not only weak as your CM Ultimate RSI indicator is showing, but it is ready to begin a turn around, question is are there an buyers to make this happen, or else it will continue its weakness.
Thanks, it will help
Great example of community input here today. I am new to the HiLo. I have been more of an ATR or Chandelier trailing trend / stop. Can anyone with experience in both provide any commentary. It seems the HiLo trails a bit far from price?
ChrisMoody PRO Alphaoptions
There are setting in the inputs tab. It defaults to 3. Higher numbers increase the distance between the bars and the lines. Decreasing the number decreases the distance from bars to Lines.
OMG!! this indicator + New Williams Vix Fix gave me great insight. Many many thanks. Praying for your new improved Vix Fix will be free as well.
Any way to set alert when Triangles change direction?
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?
Chris, read the whole blog on this. I like the clarity it offers...very good & thanks!
Hi guys, is this indicator available on the mt4 or is the script compatible with mt4? Would love to give it a try out?

thank you
United States
United Kingdom
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out