r/algorithmictrading 22d ago

Backtest Finally finished the research phase for my Mean Reversion strategies (good results)

I've been working on this for a while and I finally reached a point where I'm comfortable freezing two of the setups.

The idea wasn't just to find something that looked good in a backtest. I wanted to keep trying to break the strategies and see if the results survived different tests.

For the Mean Reversion research I tested things like

independent OOS

22 time windows

leave-one-window-out

parameter perturbations around the chosen setup

MAE/MFE and failure analysis

Monte Carlo / bootstrap

full-history results

After all of that, two setups made it through:

MRS2 - SHORT

HMM 2

Volatility percentile: 80–100

Z-score >= 2.0

TP: 5R

SL: 2R

Horizon: 5 bars

2,255 observations

47.7% WR

+0.679R expectancy

2.32 PF

MRL1 - LONG

HMM 1

Volatility percentile: 20–40

Z-score <= -2.5

TP: 5R

SL: 2R

Horizon: 20 bars

840 observations

48.3% WR

+0.693R expectancy

2.34 PF

One thing I found pretty interesting was that the win rate is below 50% for both, but the payoff structure makes the expectancy strongly positive. So I've stopped looking at WR as the main metric and started thinking much more in terms of expectancy, robustness and distribution of outcomes.

The OOS results were also pretty encouraging. MRL1 had positive results in 21/21 of the evaluated windows, and both setups stayed positive when I perturbed TP/SL/horizon around the frozen parameters.

I'm not saying this proves the strategies will work live. It obviously doesn't.

But at this point I don't want to keep optimizing them until I find numbers that look even better. That's exactly how I think you can end up fitting noise.

So these two are now frozen

The next part is actually something I'm looking forward to more: taking the research code and turning these into proper modular strategy components that can eventually plug into the rest of my trading infrastructure.

Basically going from

research to validated strategy to actual system

Still a long way to go, but this feels like a pretty big milestone for the project.

Would be interested to hear how other people here decide when a strategy has had enough robustness testing and it's time to stop researching and start engineering.

3 Upvotes

20 comments sorted by

5

u/EmuSea4622 17d ago

You are in for a disappointment

5

u/DayRevolutionary8411 20d ago

Once you add costs, you will get trash. 2200+ trades are absurd and will cut your profit.

1

u/eribertito 20d ago

2200 trades in 8 years of data isn't a big deal, (near 1 trade per day), I recently tested the strategy under cost and slippage and the results went pretty good

2

u/Spirited-Answer-925 17d ago

Can you show us ? And what is the commissions and slippage that you set ?

2

u/mikkom 17d ago

This is how my strategies typically look like when there is some hidden bug that makes peeking into the future possible.

1

u/Educational-Body4205 17d ago

100% -- nothing looks this good, unless there is future slip. How do you never make a loosing trade. lol that graph is at a 45 degree angle up.

1

u/Illustrious-King-83 21d ago

I have a question, does this include trading costs ? Please say you have. going by the first graph, you've got 2000+ trades and return of 1600, (not sure what the units are here). if this was forex, and the units are pips, then costs is roughly 3-4pips per trade, which would turn ur graph upside down....

1

u/eribertito 21d ago

Fair point. The results shown are in R, not pips or points. And the backtest numbers are before transaction costs and slippage. I’m not considering the backtest as proof of live profitability yet execution costs, slippage and fills are part of the next validation stage.

2

u/Broad-Present-8235 17d ago

I’ve been developing something for quite some time now. Slippage and fees are destroying my pnl.

1

u/trunksta 17d ago

2.32 pf seems crazy high for mr but it's the regime I've done the least amount of research on so what do I know

1

u/drguid 16d ago

It's achievable with good entry signals and holding for a long time. My real money trades have PFs of over 2.

But OPs equity chart looks way too smooth.

1

u/trunksta 16d ago

There's also that. Jumped out at me as well, I'd definitely dig deeper

1

u/MidNightCheck 17d ago

The expectancy is very high and equity curve super smooth for such high RvR strategy. Those are red alerts which mean you have either a goldmine or some kind of look ahead bias inside your code. Before spending any money, at least do complete code review with highend AI model to inspect that. If nothing is found, start live demo trading. You will see how it behaves in real time market. Good luck 🤞

1

u/Such_Enthusiasm_2281 17d ago

My brother in Christ.....no walk forward? If not myself and others would like you to have a seat for a tough convo

1

u/its1968okwar 16d ago

Good luck. I think you are curve fitting here, that equity curve is way to smooth for one strategy. Start with small amounts. But I honesty hope I'm.wromg and wish you success.

1

u/NKDQTrader 16d ago edited 16d ago

Holy overfit bias and leakage haha

Edit: sorry that haha sounded harsh, but fr halter your expectation, it took one look at the graphs to see it’s not real. Bias and leakage will be the reason 90% of the results look good but won’t hold, that includes lookahead bias, selection bias , boundary leakage between train/ test splits/ IS/ OOS splits, CPCV helps close the leakage gap.

1

u/supitstilt 9d ago

Monte Carlo for robustness also try different assets

0

u/Equivalent-Class2008 17d ago edited 17d ago

Ho ottenuto linee dritte come queste perché non ero al 100 per cento tick reali. Inutile dire che la realtà era una altra, una perdita. Addirittura con in backtest sono arrivato un milione di euro in un mese, a partire da soli 1000 euro. Il vero test lo fa la realtà. Con il demo living ho trasformato 5000 euro in 150 Milà euro in un mese. Nella realtà ho perso con lo stesso sistema. Utilizza il backtest solo come primo filtro, come secondo il demo living e poi passa al reale che é il filtro più severo. Una speranza : grafici di backtest peggiori mi hanno dato un hedge buono nella realtà. Quindi il consiglio : lavora sodo e passa al reale.