Alligator
This EA implements Bill Williams' Alligator indicator strategy for trend-following trading. It uses the three Alligator lines (Jaw, Teeth, Lips) to identify trending markets and generates entry signals when the Lips cross above or below the Teeth/Jaw. Trades are opened in the direction of the emerging trend and closed when the Alligator lines converge or flatten.
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 | -4.64% | -4.04% | 6.03% | 140 | 42.90% | -1.06 | -0.77 | 5 | −$3.31 | Reliable |
| GBPUSD | -3.34% | -2.91% | 8.44% | 140 | 42.90% | -0.60 | -0.40 | 10 | −$2.39 | Reliable |
| USDJPY | -14.01% | -12.29% | 15.38% | 141 | 39.30% | -2.78 | -0.91 | 9 | −$9.90 | Reliable |
| XAUUSD | -100.00% | -100.00% | 100.00% | 39 | 48.70% | -1.47 | -1.00 | 3 | −$267.23 | 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 13% of 95 · GBPUSD: better than 24% of 95 · USDJPY: better than 0% of 95 · XAUUSD: better than 0% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +2.16% 2026-06 | -1.72% 2026-03 |
| GBPUSD | 31% | +3.16% 2026-10 | -3.39% 2026-04 |
| USDJPY | 23% | +1.04% 2026-01 | -3.08% 2026-05 |
| XAUUSD | 25% | +2.85% 2025-11 | -100.00% 2026-02 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- 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
This strategy is based on Bill Williams' Alligator indicator, using three smoothed moving averages with different periods (Jaw, Teeth, Lips) to determine market trend states. When the three lines diverge, a trend is forming; a buy signal is generated when the Lips cross above the Teeth and Jaw, and a sell signal when the Lips cross below them, which is a classic trend-following entry condition. Exit conditions typically involve the three Alligator lines converging again or price breaking below/above the Lips, signaling trend exhaustion. Position sizing uses a fixed lot size by default, lacking any dynamic adjustment mechanism based on market conditions or account equity. Money management relies on stop-loss and take-profit parameters to control per-trade risk, but there is no adaptive sizing based on account balance or volatility. The overall strategy logic is simple and clear, suitable for strongly trending markets, but it tends to generate frequent false signals in ranging or choppy markets leading to consecutive losses.
Strengths
- Simple and intuitive strategy logic based on the classic Bill Williams Alligator indicator, easy to understand and verify
- Trend-following nature performs well in strong trending markets, capable of capturing large trend moves
- Highly configurable parameters with adjustable periods and shifts for all three lines to adapt to different instruments and timeframes
Weaknesses
- Generates frequent false signals in ranging or choppy markets, leading to consecutive small losses
- Fixed lot sizing lacks flexibility, with no dynamic adjustment based on account equity or market volatility
- Default stop-loss and take-profit are zero, creating risk of trading without protective stops which can lead to large losses
- Lacks new bar check mechanism, potentially opening multiple positions within the same bar
Possible improvements
- Add a trend filter (such as ADX indicator) to reduce trading frequency in ranging markets and avoid false signals
- Implement dynamic position sizing based on account balance and ATR volatility instead of fixed lot size
- Add new bar check and time interval controls to prevent multiple position openings within the same bar
Risk assessment
Overall risk: Medium
- Default stop-loss and take-profit are zero, trades may execute without protective stops, risking large losses
- Lacks new bar check, potentially opening multiple positions within a single bar leading to overexposure
- Consecutive false signals in ranging markets can cause cumulative drawdown
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
JawPeriod | 13 | Alligator Jaw line period |
JawShift | 8 | Jaw offset |
TeethPeriod | 8 | Alligator Teeth line period |
TeethShift | 5 | Teeth offset |
LipsPeriod | 5 | Alligator lips period |
LipsShift | 3 | Lips offset |
LotSize | 0.1 | Fixed trading lot size |
StopLoss | 0 | Stop loss in points |
TakeProfit | 0 | Take-profit in points (~10 points) |
MA_Method | MODE_SMMA | Moving average method (smoothed MA) |
AppliedPrice | PRICE_MEDIAN | Applied price type |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.