Purpose of the Gator Oscillator
The Gator Oscillator, developed by Bill Williams, is based on the Alligator. The Upper histogram shows the distance between the Jaw and the Teeth; the Lower histogram shows the distance between the Teeth and the Lips. Growing bars mean the Alligator is "eating" (a trend is under way); shrinking bars mean it is going to sleep.
How It Works
When you select Gator Oscillator in the Trade Rule block, you can configure it with the following settings:
Jaw, Teeth and Lips Periods and Shifts of Gator
The same six settings as the Alligator (standard: Jaw 13/8, Teeth 8/5, Lips 5/3).
MA Method of Gator
Method used to calculate the moving average.
Simple: Equal weight to all values.
Exponential: More weight on recent data.
Smoothed: Longer-term smoothing with reduced noise.
Weighted: Highest weight on the most recent data, decreasing linearly.
Applied Price of Gator (What the lines are calculated from)
Close Price: Uses the candle's closing price.
Open Price: Uses the candle's opening price.
High Price: Uses the highest price in the candle.
Low Price: Uses the lowest price in the candle.
Median Price: (High + Low) ÷ 2
Typical Price: (High + Low + Close) ÷ 3
Weighted Price: (High + Low + Open + Close) ÷ 4
Mode of Gator (Which histogram to use)
Upper: Distance between Jaw and Teeth. Always 0 or positive.
Lower: Distance between Teeth and Lips. Always 0 or negative, as in MetaTrader.
Choose Upper or Lower. If Jaw, Teeth or Lips is selected here, the builder shows a message asking you to choose Upper or Lower.
Time Frame of Gator
Sets the chart time frame for the Gator calculation.
Can be replaced with a variable or input for quick testing and optimization.
Candle ID of Gator
Defines which candle the calculation starts from.
0: Current candle (still forming).
1: Most recently closed candle.
Higher IDs refer to older candles.
Adjust of Gator (Modify the Result)
Apply an adjustment to the calculated value by adding, subtracting, multiplying, or dividing by a number.
Example
If you set:
Jaw: 13 / shift 8
Teeth: 8 / shift 5
Lips: 5 / shift 3
Mode: Upper
Candle ID: 1
You get the Upper histogram value of the most recently closed candle: the distance between the Jaw and the Teeth.
Use Cases
Detect a trend starting when both histograms grow.
Detect a trend fading when the bars shrink.
Avoid trading while the Alligator is asleep (bars close to 0).
⚠ Tip: Because the Lower histogram is negative, a growing Lower bar becomes more negative. Use "<" when checking whether it is growing.
⚠ Note: When you use Crosses Above or Crosses Below with this indicator, the cross is currently calculated on its first line, whatever Mode you select. To compare two specific lines, use > or < instead.

