Kloss
The Kloss EA is a mean-reversion trading system that uses CCI, Stochastic, and LWMA to identify overbought/oversold conditions for entry. It opens buy positions when CCI is deeply oversold, Stochastic main is below a threshold, and price is above the MA, and vice versa for sell signals. It features an MWMode mechanism that defers SL/TP placement until after position open to avoid broker rejection on tight stops.
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 | +3.66% | +3.17% | 3.35% | 142 | 54.60% | 0.78 | 1.09 | 5 | +$2.84 | Reliable |
| GBPUSD | +9.98% | +8.62% | 4.22% | 144 | 57.30% | 1.57 | 2.37 | 4 | +$7.15 | Reliable |
| USDJPY | -2.17% | -1.89% | 7.55% | 144 | 51.70% | -0.37 | -0.29 | 5 | −$1.63 | Reliable |
| XAUUSD | -57.48% | -50.67% | 100.00% | 151 | 49.00% | 0.77 | -0.57 | 5 | −$38.07 | 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 Mean Reversion EAs with a reliable result on the same market: EURUSD: better than 80% of 30 · GBPUSD: better than 97% of 32 · USDJPY: better than 31% of 32 · XAUUSD: better than 23% of 31
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 69% | +2.31% 2026-07 | -2.09% 2026-09 |
| GBPUSD | 69% | +3.25% 2026-07 | -1.81% 2026-01 |
| USDJPY | 46% | +3.32% 2026-09 | -3.89% 2026-01 |
| XAUUSD | 38% | +42.14% 2026-05 | -50.86% 2026-01 |
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
This strategy is based on the mean reversion concept, assuming that prices will revert to the mean after deviating. Entry conditions: a buy signal requires CCI below -CCIDiffer (default -120), Stochastic main line below 50-StDiffer (default 30), and close price above the LWMA; sell signals are the mirror opposite with CCI above +CCIDiffer, Stochastic above 50+StDiffer, and close below the MA. Exit conditions come in two forms: stop loss/take profit triggers (default 550 points each), or reverse signal closure when RevClose is enabled. Position sizing supports both fixed lots and risk-based dynamic lot calculation, where Lots=0 triggers calculation using account free margin multiplied by MaximumRisk divided by 1000. Money management is handled by fLotsNormalize which rounds lot size to conform with broker minimum volume and step requirements. The MWMode mechanism is a clever design that opens positions with zero SL/TP first, then modifies them on subsequent ticks via PositionModify, adjusting to satisfy StopsLevel requirements and avoiding rejection for stops being too close at order time.
Strengths
- Triple indicator filter (CCI + Stochastic + MA) reduces false signals with strict entry conditions
- The MWMode mechanism cleverly solves the problem of broker rejection for stops being too close, improving order fill rates
- Position sizing supports both fixed lots and dynamic risk-based calculation, offering good flexibility
- Symmetric SL/TP that can each be set to 0 to disable, giving traders ample parameter tuning space
- All indicator parameters and shift offsets are adjustable, facilitating optimization and backtesting across timeframes
Weaknesses
- MAPeriod defaults to 1, making the LWMA essentially the price itself, which severely weakens its filtering purpose
- The dynamic lot formula (FreeMargin * MaximumRisk / 1000) lacks theoretical basis and does not account for stop loss distance
- The rv variable in SolveLots is always true with no actual lot validity verification, making the return value meaningless
- No proper new bar check mechanism; when ZeroBar is true, trading logic may execute on every tick
- No spread filter — entries can occur during wide spreads, which is detrimental for a mean reversion strategy
Possible improvements
- Change MAPeriod default from 1 to a reasonable period (e.g., 14-20) so the MA actually serves as a trend filter
- Improve dynamic lot calculation to risk-based sizing: lots = risk amount / (stop loss points * point value), which is the standard position sizing approach
- Add a spread filter to prevent entries when the spread exceeds a threshold, avoiding excessive slippage
Risk assessment
Overall risk: Medium
- MAPeriod=1 disables the MA filter, leaving the strategy without trend direction confirmation and potentially causing frequent counter-trend entries
- Lot calculation ignores stop loss distance, which can lead to excessive per-trade risk on volatile instruments
- When ZeroBar is true, there is no effective new bar check, potentially causing repeated trades within the same bar
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Lots | 0.1 | Fixed trading lot size |
MaximumRisk | 0.05 | Risk percentage for dynamic lot calculation when Lots=0 |
StopLoss | 550 | Stop loss in points; 0 disables stop loss |
TakeProfit | 550 | Take profit in points; 0 disables take profit |
RevClose | true | Close position on reverse signal |
MAPeriod | 1 | MA indicator period |
MAMethod | MODE_LWMA | MA method; default is linear weighted moving average |
MAPrice | PRICE_TYPICAL | MA applied price type |
MAShift | 5 | MA bar shift offset |
PShift | 1 | Price bar shift offset |
CCIPeriod | 10 | CCI indicator period |
CCIPrice | PRICE_WEIGHTED | CCI applied price type |
CCIDiffer | 120 | CCI threshold level for deviation from zero |
CCIShift | 0 | CCI bar shift offset |
StKPeriod | 5 | Stochastic K period |
StDPeriod | 3 | Stochastic D-line period |
StSPeriod | 3 | Stochastic smoothing period |
StMethod | MODE_SMA | Stochastic calculation method |
StPrice | STO_LOWHIGH | Stochastic price type |
StShift | 0 | Stochastic bar shift for check |
StDiffer | 20 | Stochastic threshold, deviation from level 50 |
CommonShift | 1 | Common shift added to all indicator Shift variables |
MWMode | true | Set SL/TP after open to avoid rejection |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.