GannSwingOscillator: Indicator Documentation
Syntax
DataSeries GannSwingOscillator( Bars bars, bool zero );
Parameter Description
bars |
A Bars object |
zero |
True = with zero, False = discrete |
Description
The Gann Swing Oscillator is described in Robert Krausz's book "A W.D. Gann Treasure Discovered" and is a simple indicator that defines market swings. A Swing High is defined by 2 consecutive higher highs followed by 2 consecutive lower highs, and a Swing Low is defined by 2 consecutive lower lows followed by 2 consecutive higher lows. An Swing High is indicated by a +1 value of the oscillator while a Swing Low is indicated by a -1 value.
You have the option to plot a zero value or disable that feature. Regular version of the indicator keeps the last assigned value and stays that way until changed. With trailing zero enabled, the extremum value is triggered on
that bar only. For all the other bars, it's not changed and therefore remains zero. This can be helpful to detect the bar on which a Swing High/Low took place.
Interpretation
Although the oscillator is designed to be used together with other Gann indicators created by Krausz as a trading system methodology, you can simply use it to find market direction to trade only with the established market trend.
Example
This example illustrates how to plot and trade with the Gann Swing Oscillator.
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using Community.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
GannSwingOscillator gsZero = GannSwingOscillator.Series( Bars, true );
GannSwingOscillator gsRegular = GannSwingOscillator.Series( Bars, false );
gsZero.Description = "Swings (with zero)";
gsRegular.Description = "Swings (regular version)";
HideVolume();
ChartPane gsPane1 = CreatePane( 30, true, false );
ChartPane gsPane2 = CreatePane( 30, true, false );
PlotSeries( gsPane1, gsZero, Color.Blue, LineStyle.Solid, 2 );
PlotSeries( gsPane2, gsRegular, Color.Blue, LineStyle.Solid, 2 );
}
}
}