I don't know if many of you have heard of the fritzagger indicator. It's great to identify swings.
My criteria for selecting this indicator was:
- Return swing values only when the swing is 100% formed, not when it is redrawn on every bar. (we can cross out Swing and ZigZag from ninjatrader)
- Can be used in multiple timeframes without having to adjust it's parameters (we can cross out the ZigZag from ninjatrader)
- Use either High/Low or Close for the Swings (we can cross out Swing from ninjatrader)
- Shows the swings and the zigzags in the chart (we can cross out Swing from ninjatrader)
- Return values that can be used in 100% automated strategies (we can cross out PriceActionSwing)
All credit to Alex Matulich for this awesome indicator.
fritzagger.cs
Code (if you're hesitant to download)
/*
fritzagger - another zig zag indicator
by Alex Matulich, [email protected]
Unicorn Research Corporation, September 2008
I derived this from the verbal description on page 39 of
_The Ultimate Trading Guide_ by John R. Hill, George Pruitt, and Lundy Hill
published (2000) by John Wiley and Sons, Inc, ISBN 0-471-38135-7
Instead of using an arbitrary pullback amount to identify a swing high
or a swing low, this zigzag indicator uses an objective definition:
A swing high bar is the highest high prior to penetration of the low
of that highest high bar. A swing low bar is the lowest low prior to
penetration of the high of that lowest low bar.
This indicator goes a bit further by introducing a 'span' parameter.
When span=1, the indicator behaves as described in the book. When
span>1, the highs and lows are calculated as the highest and lowest in
a sliding window 'span' bars wide. Increasing the size of 'span' causes
the indicator to ignore the smaller swings. When span=6, this indicator
matches Larry Williams' zigzag description in his "Money Tree" course.
If you set "Use Highs and Lows" to false, then only input prices (such
as closes) will be used. In this case, you should increase span to 2 or
higher to avoid identifying nearly every price as a swing.
This indicator has a number of public properties that can be accessed
from other indicators.
*/
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
///
/// ZigZag indicator from the Ultimate Trading Guide by Hill, Pruitt, and Hill. A swing high occurs when price takes out the low of the highest bar. A swing low occurs when price takes out the high of the lowest bar. Span setting determines how many bars to look back for highest highs and lowest lows; i.e. span=5 on daily bars find weekly swings.
/// add HH/LL trend lines and rays 11/14/09 -Cory
/// add fib suite 11/25/09 - Cory
/// add prices 3/28/11 - Cory
///
[Description("ZigZag indicator from the Ultimate Trading Guide by Hill, Pruitt, and Hill. A swing high occurs when price takes out the low of the highest bar. A swing low occurs when price takes out the high of the lowest bar. Span setting determines how many bars to look back for highest highs and lowest lows; i.e. span=5 on daily bars find weekly swings.")]
public class fritzagger : Indicator
{
#region Variables
// Wizard generated variables
private int span = 2; // Default setting for Span
private bool useHiLo = true; // Default setting for UseHiLo
private Color zigZagColor = Color.Transparent; // Default setting for zigZagColor
private int show = 3; // Default setting for Show
// User defined variables (add any user defined variables below)
private DataSeries hi, lo;
private bool drawlines, showdots;
private int linewidth = 2;
// Useful public …