SAR trading v2.0
This EA uses the Parabolic SAR indicator as its primary signal generator to identify trend direction and generate buy/sell entries. It enters long when SAR dots flip below price and enters short when SAR dots flip above price, with configurable parameters for SAR step and maximum. The EA manages positions with stop loss and take profit levels derived from the SAR values and ATR-based calculations.
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 | -5.51% | -4.81% | 9.00% | 132 | 50.00% | -1.11 | -0.61 | 7 | −$4.18 | Reliable |
| GBPUSD | -0.65% | -0.56% | 5.66% | 130 | 51.50% | -0.08 | -0.12 | 5 | −$0.50 | Reliable |
| USDJPY | +4.66% | +4.03% | 4.75% | 134 | 57.50% | 0.94 | 0.98 | 5 | +$3.47 | Reliable |
| XAUUSD | +157.74% | +118.64% | 30.53% | 142 | 56.00% | 2.06 | 5.17 | 5 | +$113.63 | 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 9% of 95 · GBPUSD: better than 40% of 95 · USDJPY: better than 93% of 95 · XAUUSD: better than 96% of 96
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 31% | +1.22% 2026-08 | -4.36% 2026-03 |
| GBPUSD | 46% | +2.51% 2026-02 | -2.18% 2026-01 |
| USDJPY | 62% | +1.99% 2026-01 | -1.61% 2026-07 |
| XAUUSD | 77% | +32.58% 2026-02 | -17.08% 2026-05 |
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 core strategy of this EA is a trend-following system based on the Parabolic SAR (Stop and Reverse) indicator. Entry conditions are: open a long position when the SAR flips from above price to below price, signaling the start of an uptrend; open a short position when the SAR flips from below price to above price, signaling the start of a downtrend. Exit conditions rely on SAR reversal signals as well as preset stop loss and take profit ratios, with stops typically placed near the SAR value or dynamically calculated using ATR. Position sizing employs either fixed lots or an equity percentage-based approach depending on parameter configuration. Money management provides a risk percentage parameter to control exposure per trade, but does not employ complex Martingale or grid strategies. The overall strategy logic is clear and suitable for strongly trending markets, but in ranging or choppy markets it tends to generate frequent false signals leading to consecutive losses.
Strengths
- Simple and clear strategy logic based on the classic SAR indicator, easy to understand and verify
- Performs well in trending markets, capable of capturing long trend waves
- Highly configurable parameters, SAR step and maximum can be adjusted for different markets
- Built-in magic number management allows multiple EAs to run in parallel without conflicts
- Risk percentage parameter provides a basic money management framework
Weaknesses
- Frequent false signals in ranging markets, leading to consecutive small losses
- SAR indicator has noticeable lag, entries are delayed and may miss early trend profits
- Lacks a trend filter (such as MA or ADX), opens positions even when there is no clear trend
- Stop loss relies on SAR values, which can be too wide during high volatility causing large single-trade losses
- No spread filter mechanism, trading costs significantly impact performance in high-spread environments
Possible improvements
- Add a trend filter (such as EMA200 or ADX) to only allow SAR signals when the trend is clear, reducing false trades in ranging markets
- Implement ATR-based dynamic position sizing and stop loss calculation to automatically adjust risk exposure and stop distance based on market volatility
Risk assessment
Overall risk: Medium
- SAR frequent reversals in ranging markets cause repeated entries and exits, accumulating significant transaction costs and slippage
- When stops rely on SAR values, stop distance can be excessively wide on volatile instruments, leading to high single-trade loss ratios
- No maximum consecutive loss limit or daily drawdown control, potentially sustaining losses during extreme market conditions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
SAR_Step | 0.02 | SAR acceleration factor step, controls SAR follow speed |
SAR_Maximum | 0.2 | SAR acceleration factor maximum, limits SAR sensitivity |
LotSize | 0.1 | Fixed lot size per trade |
StopLoss | 0 | Stop loss in points, 0 to disable |
TakeProfit | 0 | Total profit target in points |
RiskPercent | 2 | Risk percentage per trade for dynamic position sizing |
MagicNumber | 12345 | EA unique identifier |
MaxSlippage | 3 | Maximum slippage tolerance |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.