BARS Alligator
This EA trades based on Bill Williams' Alligator indicator, opening positions when the Alligator lips, teeth, and jaw lines diverge indicating a trending market. It enters long when price is above all three smoothed moving averages and short when below, exiting when the lines converge or cross. The system is a classic trend-following approach using the Alligator's sleep/awake phases to filter trades.
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 | -8.89% | -7.77% | 10.57% | 140 | 41.70% | -1.85 | -0.84 | 6 | −$6.64 | Reliable |
| GBPUSD | -12.55% | -11.00% | 14.73% | 142 | 41.80% | -2.06 | -0.85 | 8 | −$9.07 | Reliable |
| USDJPY | -3.65% | -3.18% | 8.20% | 139 | 48.90% | -0.71 | -0.45 | 8 | −$2.63 | Reliable |
| XAUUSD | -98.27% | -96.49% | 99.40% | 32 | 56.20% | -1.50 | -0.99 | 5 | −$307.08 | 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 2% of 95 · GBPUSD: better than 3% of 95 · USDJPY: better than 23% of 95 · XAUUSD: better than 8% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +1.64% 2026-09 | -3.79% 2026-02 |
| GBPUSD | 15% | +4.68% 2026-03 | -4.99% 2026-02 |
| USDJPY | 62% | +1.39% 2026-01 | -4.66% 2026-09 |
| XAUUSD | 15% | +15.40% 2025-11 | -97.12% 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 Bill Williams' Alligator indicator, using three smoothed moving averages (Jaw 13-period, Teeth 8-period, Lips 5-period) and their convergence/divergence to determine market trend phases. Entry conditions: go long when the three lines begin diverging upward from an entangled state and price is above the Lips line; go short when they diverge downward and price is below the Lips line. Exit conditions: close positions when the three lines start converging or crossing, signaling the trend may be ending. Position sizing typically uses fixed lots or a percentage of account equity, with some versions supporting pyramiding logic. Money management relies on the Alligator's sustained divergence to hold profitable positions, while avoiding entries during ranging markets when the lines are entangled, thus reducing losses from false signals. The overall strategy logic is clear, but the lack of explicit stop-loss mechanisms means the EA may suffer significant drawdowns during trend reversals.
Strengths
- Based on a classic technical indicator with clear and understandable strategy logic, well-suited for trending markets
- The Alligator's entanglement/divergence mechanism effectively filters out false signals during ranging markets
- Multiple moving average confirmation of trend direction reduces the frequent trading problem of single-MA systems
Weaknesses
- Lacks explicit stop-loss mechanisms, potentially suffering significant drawdowns during trend reversals
- Although it reduces entries in ranging markets, existing positions may continue losing due to lack of clear exit rules
- Pure Alligator strategy enters late during trend formation, missing some profit potential at the beginning
Possible improvements
- Add explicit stop-loss and trailing stop mechanisms to control maximum loss per trade
- Incorporate auxiliary indicators (such as AO or AC oscillators) for entry confirmation to improve signal quality
- Add a position sizing module that dynamically adjusts lot size based on account risk
Risk assessment
Overall risk: Medium
- Lacks hard stop-loss protection, which may lead to large losses during extreme market conditions
- Alligator indicator has significant lag, causing both entry and exit signals to be late
- Lack of position state checking may lead to duplicate position opening
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
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 |
Lots | 0.1 | Trading lot size |
StopLoss | 0 | Stop loss in points (0 = no stop loss) |
TakeProfit | 0 | take profitpoints (0meansnotake profit) |
MagicNumber | 12345 | EA magic number for distinguishing orders |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.