RideAlligator
This EA trades based on the Williams Alligator indicator, entering long positions when price is above the Alligator's lips and short positions when below, riding the trend until the Alligator lines converge signaling trend exhaustion. It uses the jaw, teeth, and lips relationship to determine trend direction and strength, opening trades when lines are properly aligned and wide apart.
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 | -2.98% | -2.60% | 6.49% | 125 | 48.80% | -0.68 | -0.46 | 4 | −$2.39 | Reliable |
| GBPUSD | +6.02% | +5.21% | 4.30% | 131 | 46.90% | 1.01 | 1.40 | 11 | +$4.40 | Reliable |
| USDJPY | -0.87% | -0.76% | 6.12% | 135 | 40.30% | -0.11 | -0.14 | 9 | −$0.76 | Reliable |
| XAUUSD | +144.34% | +109.21% | 45.75% | 151 | 54.30% | 1.85 | 3.15 | 5 | +$95.59 | Reliable |
Profitable on 2 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 25% of 95 · GBPUSD: better than 86% of 95 · USDJPY: better than 48% of 95 · XAUUSD: better than 95% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +1.56% 2026-09 | -2.03% 2026-04 |
| GBPUSD | 77% | +2.85% 2026-03 | -1.96% 2026-04 |
| USDJPY | 46% | +1.52% 2025-11 | -1.50% 2026-05 |
| XAUUSD | 77% | +57.84% 2026-03 | -9.18% 2026-04 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
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 Bill Williams' Alligator indicator, using three smoothed moving averages (Jaw, Teeth, Lips) whose opening and closing patterns determine market trend states. Entry conditions: for long positions, the Lips must be above the Teeth and the Teeth above the Jaw, with all three lines in bullish alignment and widening gaps indicating an established uptrend; for shorts, the reverse bearish alignment is required. Exit conditions rely on Alligator line convergence, closing positions when lines begin to approach each other or cross, signaling potential trend exhaustion. Position sizing typically uses fixed lots or a percentage of account equity. Money management may include stop-loss settings, but the core philosophy of the Alligator strategy is to let profits run, so stops tend to be wide. Overall, this is a classic trend-following system that profits during clear trends but can suffer consecutive losses in ranging markets.
Strengths
- Based on a classic and widely recognized trend-following indicator with clear and understandable logic
- The Alligator indicator effectively identifies trend initiation and termination, avoiding false signals in ranging markets
- The ride-the-trend philosophy allows profits to run fully, offering high reward-to-risk potential
- Triple-line alignment provides multiple confirmation layers, reducing false entries
Weaknesses
- As a trend-following system, it is prone to consecutive losses in ranging markets where Alligator lines repeatedly cross causing frequent open-close cycles
- Default stop-loss of zero or wide settings can lead to significant drawdowns during trend reversals
- Lacks a volatility filter, so signal quality degrades in low-volatility environments
- Fixed lot sizing lacks dynamic position management, unable to adjust risk exposure based on market conditions
Possible improvements
- Add Awesome Oscillator or Accelerator Oscillator as a supplementary filter, entering only when oscillator direction aligns with Alligator direction to reduce false signals in ranging markets
- Implement ATR-based dynamic stop-loss and position sizing to automatically adjust risk exposure based on market volatility
- Add new bar detection to prevent repeated trading within the same bar, and include a spread filter to protect against excessive trading costs
Risk assessment
Overall risk: Medium
- Default stop-loss of zero can lead to significant losses during trend reversals
- Frequent Alligator line crossovers in ranging markets cause repeated trading and commission drain
- Lack of new bar detection may result in multiple entries within the same bar
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lots | 0.1 | Fixed trading lot size |
StopLoss | 0 | Stop loss in points, 0 means no stop loss |
TakeProfit | 0 | Take profit in points, 0 means no take profit |
JawPeriod | 13 | Alligator jaw period |
TeethPeriod | 8 | Alligator teeth period |
LipsPeriod | 5 | Alligator lips period |
JawShift | 8 | Jaw offset |
TeethShift | 5 | Teeth offset |
LipsShift | 3 | Lips offset |
MagicNumber | 12345 | EA magic number for identifying orders |
TrailingStop | 0 | Trailing stop in points, 0 to disable |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.