Alligator (Bill Williams)

Modified on 2010/09/11 10:34 by Eugene — Categorized as: Community Indicators

Syntax


public AlligatorJaw(DataSeries ds, int period, int delay, string description)
public static AlligatorJaw Series(DataSeries ds, int period, int delay)

public AlligatorTeeth(DataSeries ds, int period, int delay, string description) public static AlligatorTeeth Series(DataSeries ds, int period, int delay)

public AlligatorLips(DataSeries ds, int period, int delay, string description) public static AlligatorLips Series(DataSeries ds, int period, int delay)

Parameter Description

ds The source DataSeries
period Moving average period
delay Delay to offset the MA, bars/td>

Description

The Alligator by Bill Williams is a combination of the 3 indicators that helps to determine a trend:

Alligator's Jaw (the blue line) - 13-period smoothed moving average at the mid price (High+Low)/2, which is offset 8 bars into the future;

Alligator's Teeth (the red line) - 8-period smoothed moving average at the mid price (High+Low)/2, which is offset 5 bars into the future;

Alligator's Lips (the green line) - 5-period smoothed moving average at the mid price (High+Low)/2, which is offset 2 bars into the future.

Note! The Alligator lines in Community Indicators prior to version 2010.10 were not totally correct. Instead of the smoothed moving average, they used a simple moving average. Upgrade your library to the most actual version using Extension Manager.

Interpretation


Example

The following example will plot the Alligator:


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using Community.Indicators;

namespace WealthLab.Strategies { public class AlligatorDemo : WealthScript { protected override void Execute() { AveragePrice ds = AveragePrice.Series(Bars); AlligatorJaw aj = AlligatorJaw.Series(ds, 13, 8); AlligatorTeeth at = AlligatorTeeth.Series(ds, 8, 5); AlligatorLips al = AlligatorLips.Series(ds, 5, 2);

HideVolume(); PlotSeries( PricePane, aj, Color.Blue, LineStyle.Solid, 1 ); PlotSeries( PricePane, at, Color.Red, LineStyle.Solid, 1 ); PlotSeries( PricePane, al, Color.Green, LineStyle.Solid, 1 ); } } }