PDA

View Full Version : Alligator and Gator Oscillator


NinjaTrader_Josh
08-10-2007, 12:24 AM
Alligator and Gator Oscillator by Bill Williams
http://i11.tinypic.com/6fioyee.png

Usage: http://www.metaquotes.net/techanalysis/indicators/alligator/

Syntax
Alligator()
Gator()To get the value of the various Alligator lines:
Alligator().Jaw[int barsAgo]
Alligator().Teeth[int barsAgo]
Alligator().Lips[int barsAgo]To get the Gator bar values:
Gator().JawTeeth[int barsAgo]
Gator().LipsTeeth[int barsAgo]Also included in the package is an indicator for SMMA (Smoothed Moving Average).
In the middle of http://www.adblue.de/cqg/movings.htm discusses the calculations of the SMMA.

As always, please let me know if you see any bugs/miscalculations or have suggestions/comments. Thank you.

Bug Fix: Fixed an error on SMMA when used with CalculateOnBarClose = false.

rally
08-10-2007, 02:46 AM
Uacvx, this is awesome stuff, your efforts are really appreciated.

Pipqueen
02-22-2008, 08:04 PM
Uacvx, this is awesome stuff, your efforts are really appreciated.
Love the indicator and the alligator explanation. THank you so much for sharing!

NinjaTrader_Josh
03-28-2008, 05:03 PM
There has been a bug fix to this indicator. If you are using it please update.

Pipqueen
03-29-2008, 10:41 AM
Thank you so much Josh, I do use the alligator!:)

sbgtrading
04-03-2008, 07:40 AM
Hi everyone,

I found an issue with the Gator Oscillator...most histo bars were green when this was running in real-time. If you've experienced this problem, I've attached the fix to this post.

Enjoy!
Ben

NinjaTrader_Josh
04-04-2008, 02:07 AM
Thanks for the fix Ben.

achung
04-05-2008, 11:02 AM
Hello there,

I am considering switching over to NT from Sierra Charts and have played around with the Alligator indicators on both platforms. There appears to be a discrepancy in the way the indicators are plotted and I am wondering whether or not it could be due to the offsets in the code.

Attached are JPEGS of the indicators working on both platforms -- as you can see, the shapes of the lines are almost identical. However, the vertical offset seems to be different --> but which chart is correct? Is it possible that different sums are being used as well?

I have checked with SC and they are using the following formula:
+++++++++++++++++++++++
Smooth:

A Smoothed Moving Average is similar to a simple moving average. However, in a smoothed moving average, rather than subtracting the oldest value the previous smoothed average value is subtracted.

For the following example the PERIOD equals 3.

The first value for a Smoothed Moving Average is determined by the formula SMOOTH. It is plotted on the chart at the third bar from the left side of the screen.

SMOOTH =(PRICE 1 + PRICE 2 + PRICE 3)/PERIOD

The next value would be plotted at the fourth bar from the left side of the screen.

SMOOTH2 = (PREVIOUS SUM - PREVIOUS AVG + PRICE 4)/PERIOD

For the second calculation of SMOOTH, PREVIOUS SUM is the sum of PRICE 1 + PRICE 2 + PRICE 3; and PREVIOUS AVG is the initial value of SMOOTH.

The next value would be plotted at the fifth bar from the left side of the screen. SMOOTH = (PREVIOUS SUM - PREVIOUS AVG + PRICE 5)/PERIOD. Subsequent values would be determined by subtracting the PREVIOUS AVG from the PREVIOUS SUM, adding the next more recent PRICE, then dividing by the PERIOD.
++++++++++++++++++++++++

Thanks.
Warmest regards,
Andrew

NinjaTrader_Josh
04-05-2008, 03:13 PM
Hi achung,

From the screenshots you may be using an older version of the indicator which had a bug in regards to converging plots in live data. Please try updating and seeing if that helps. Other than that, the SMMA implementation should be the same as you described.