An Expert Advisor doesn't merely signal like an indicator does — it opens and manages positions for you. This free EA trades a trend-following strategy built entirely on Bill Williams' Alligator and Gator Oscillator working together: the Gator confirms the Alligator has genuinely woken up before any trade is considered, and the Alligator's own line order decides which direction that confirmed trend actually favors.
How the Strategy Works
This EA reuses exactly the entry logic covered in the Gator Oscillator lesson: it requires both of the Gator's histograms — the Jaw-Teeth spread and the Teeth-Lips spread — to be growing on the same bar, which is the mechanical signature of the Alligator's lines actively fanning apart rather than sitting tangled or already fully separated and flattening out. Growth alone doesn't say which direction to trade, so the EA also reads the Alligator's own Jaw/Teeth/Lips order at that same bar: a bullish fan (Lips above Teeth above Jaw) points long, a bearish fan (Lips below Teeth below Jaw) points short. Only when both conditions line up on the same bar — active growth and a clear fan order — does the EA consider an entry, which is deliberately more selective than trading on either signal alone.
Stop Loss, Take Profit, and Position Sizing
Unlike the Fractals Breakout EA or Parabolic SAR Trend EA, the Gator Oscillator itself has no natural price level to anchor a stop to — a histogram value isn't a price, so there's nothing on the chart analogous to a broken fractal or a SAR dot to place a Stop Loss against. This EA uses the same ATR-based approach as most other EAs on this site instead: Stop Loss distance is ATRMultiplier × ATR (default multiplier 2.0), recalculated fresh at the moment each trade opens so it automatically widens on volatile pairs and tightens on calm ones. Take Profit is then set at RiskRewardRatio × that same Stop Loss distance (default 2.0), keeping every trade's risk and reward in a fixed, known proportion.
Position size follows the same worked-example method taught in Risk Management Basics: a RiskPercent of account balance (default 1.0%) divided by the ATR-based Stop Loss distance, converted through the symbol's tick value and normalized to the broker's lot step. A UseFixedLot input with a FixedLotSize value is available as an escape hatch for traders who'd rather trade a constant lot size regardless of risk.
Entry Conditions
- BUY — on the most recently completed bar, both Gator histograms are growing (each larger in absolute value than the bar before it) and the Alligator lines read Lips above Teeth above Jaw.
- SELL — both Gator histograms are growing and the Alligator lines read Lips below Teeth below Jaw.
The EA evaluates these conditions once per new bar only, tracked against the time of the current bar's open, never on every tick. It opens at most one position at a time, counted and filtered by its own magic number (MagicNumber, default 20260801), so it never confuses a position it opened with one you opened manually or one belonging to a different EA on the same account. Before opening anything, it also checks the current spread against MaxSpreadPoints and skips the entry entirely if the market is too illiquid at that moment.
Parameters
Everything else — stop sizing, the risk-reward target, the risk-percent lot calculation, the spread filter, and the master switch — is the standard risk engine shared by all EAs on this site, documented in full on the EAs page. This EA marks its orders with magic number 20260801.
- JawPeriod / JawShift, TeethPeriod / TeethShift, LipsPeriod / LipsShift (default 13/8, 8/5, 5/3) — the same Alligator settings covered in the Alligator and Gator Oscillator lessons, since this EA's signal is built entirely from those two indicators' shared calculation.
- MAMethod / AppliedPrice (default SMMA / Median Price) — the smoothing method and price source used by both the Alligator and Gator calculations.
- UseFixedLot / FixedLotSize — trade a constant lot size instead of risk-based sizing.
Why Require Both Growth and Fan Order
It's worth being explicit about why this EA checks two conditions instead of one, since either alone would be simpler to code. Trading on the fan order alone (Lips above Teeth above Jaw, without checking Gator growth) would catch a fan that's already fully established and possibly flattening out — the trend may be mature or even nearing exhaustion by the time the lines settle into a clean order, since the Alligator itself is a heavily lagging, smoothed indicator. Trading on Gator growth alone, without checking which way the fan points, would catch the earliest hint that the lines are separating, but with no information about direction at all. Requiring both together targets a narrower, more specific moment: the Alligator's lines are actively separating (not already separated and stalling) and they're doing so in a confirmed direction. This costs the EA some of the very earliest entries a single-condition system might catch, in exchange for filtering out both stale, already-extended fans and directionless growth that hasn't resolved into a clear trend yet.
A Word of Caution
Demo-test it first under as many market conditions as you can — performance to date, backtested or live, never guarantees future performance. Losing trades are part of any strategy, human or automated, and this EA is no exception. Both the Alligator and Gator are lagging by construction, so even a confirmed growing-and-fanned signal is confirming a trend that's already partly underway, not predicting one — entries from this EA will systematically arrive somewhat late relative to the actual turn. A choppy, range-bound market can also occasionally produce a bar or two of apparent Gator growth without a real trend forming, since growth is only ever measured against the single prior bar; consider checking Trend vs Range before enabling it on a live account. Open the source in MetaEditor and walk through it; if a parameter's purpose isn't clear to you yet, that's the signal to keep reading before you use it. As with every lesson on this site, this is educational material, not advice tailored to your situation.