Alligator
This EA trades based on the Bill Williams Alligator indicator, which uses three smoothed moving averages (Jaw, Teeth, Lips) to identify trend direction and dormancy periods. It enters long positions when the Lips cross above the Teeth and Jaw indicating an uptrend, and enters short positions when the Lips cross below indicating a downtrend. The EA closes positions when the Alligator lines converge or cross in the opposite direction, signaling trend exhaustion.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | -1.34% | -1.16% | 7.71% | 29 | 44.80% | -0.24 | -0.17 | 4 | −$4.62 | Reliable |
| GBPUSD | -6.77% | -5.91% | 11.05% | 30 | 48.30% | -1.10 | -0.61 | 4 | −$24.35 | Reliable |
| USDJPY | -5.96% | -5.20% | 10.58% | 55 | 33.30% | -1.10 | -0.56 | 8 | −$11.13 | Reliable |
| XAUUSD | -100.00% | -100.00% | 100.00% | 7 | 28.60% | -1.76 | -1.00 | 5 | −$1,439.71 | Account stopped out |
Profitable on 0 of 4 markets with reliable results.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Against the other Trend Following EAs with a reliable result on the same market: EURUSD: better than 43% of 95 · GBPUSD: better than 9% of 95 · USDJPY: better than 12% of 95 · XAUUSD: better than 0% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +1.63% 2026-09 | -2.30% 2026-06 |
| GBPUSD | 23% | +1.84% 2026-10 | -2.61% 2026-04 |
| USDJPY | 38% | +0.99% 2025-11 | -2.91% 2026-02 |
| XAUUSD | 50% | +16.74% 2025-11 | -100.00% 2026-02 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- Has no stop loss or trailing stop
- Hit a stop-out in our backtest (equity below 10%) on XAUUSD
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept is based on the Bill Williams Alligator indicator, which uses the arrangement and separation of three smoothed moving averages with different periods to determine market trend states. Entry conditions: go long when the Lips (short-period) cross above the Teeth (medium-period) and the Teeth is above the Jaw (long-period); go short when the Lips cross below the Teeth and the Teeth is below the Jaw. Exit conditions: close positions when the three lines begin to converge and intertwine (Alligator closing its mouth), signaling trend exhaustion or transition to a ranging market. Position sizing typically uses either fixed lots or a balance-based percentage calculation. In terms of money management, the EA relies on trend continuation for profit, holding positions when the Alligator lines diverge and exiting when they converge, but lacks an explicit stop-loss mechanism, relying entirely on indicator signals for position closure. The overall strategy logic is clear and represents a classic trend-following system, but it is prone to frequent false signals and consecutive losses in choppy or ranging markets where the Alligator lines repeatedly cross.
Strengths
- Clear strategy logic based on the well-established Bill Williams theory, easy to understand and verify
- Performs well in trending markets where Alligator line divergence effectively captures medium-to-long-term trends
- Intuitive parameters allowing flexible adjustment of line periods and shifts for different markets and timeframes
Weaknesses
- Generates frequent false signals in ranging/choppy markets, leading to consecutive small losses
- Lacks an explicit stop-loss mechanism, relying entirely on indicator signals for exits, which creates significant drawdown risk
- The Alligator is inherently a lagging indicator, causing late entries that may miss the initial portion of a trend
Possible improvements
- Add explicit stop-loss and take-profit mechanisms to limit per-trade losses
- Incorporate a trend strength filter (e.g., ADX) to reduce trading frequency in weak-trend environments
- Add a new bar check mechanism to prevent repeated position opening within the same candle
Risk assessment
Overall risk: Medium
- No hard stop-loss, potentially facing significant drawdowns during extreme market movements
- Consecutive false signals in ranging markets lead to persistent capital erosion
- Indicator lag causes late entries, and exits may be too slow during trend reversals
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
JawPeriod | 13 | Alligator Jaw line period (long-term SMMA) |
TeethPeriod | 8 | Alligator Teeth line period (mid-term SMMA) |
LipsPeriod | 5 | Alligator Lips line period (short-term SMMA) |
JawShift | 8 | Jaw offset |
TeethShift | 5 | Teeth offset |
LipsShift | 3 | Lips offset |
LotSize | 0.1 | Fixed lot size (0 = dynamic calculation) |
MagicNumber | 12345 | EA magic number to identify its own orders |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.