Guides · Strategies · 6 min read

Curve Fitting: When Optimisation Stops Being Research

What curve fitting is in backtesting, how to spot the moment tuning becomes decoration, and the out-of-sample check that exposes it.

The Market Makers deskPart of Strategies

MARKET MAKERSWhen tuning stops being researchGUIDE · CURVE FITTING

You ran a backtest. The rules lost money over the sample. So you widened the stop, moved the moving average from twenty to fifty, added a session filter, and ran it again. The curve looked better. You did it once more. Better still.

Somewhere in that sequence the work stopped being research and turned into decoration. Nothing on the screen told you when. The equity line got smoother the whole way, which is exactly the problem: the feedback you were watching was the feedback you were fitting to.

This guide names that moment and gives you the check that exposes it.

A backtest is a record of what one set of rules would have done in one sample. It is memory, not evidence.

What Curve Fitting Actually Is

Every price series contains two things mixed together: behaviour that repeats, and accident that does not. A level that held three times in March held partly because participants defend round numbers and partly because of who happened to be in the market that week. The chart does not label which part is which.

Curve fitting is what happens when your rules end up describing the accident. The rules still make sense on paper. The test still runs. The history still looks orderly. But what you have built is a description of one sample rather than a description of a market behaviour.

The mechanism is degrees of freedom. Each parameter is a dial: a lookback, a threshold, a stop distance, a time window, a filter. One dial bends the result a little. Six dials bend it a lot. With enough dials you can reproduce almost any history, because you are no longer testing an idea, you are searching a space until something matches. A backtest is a record of what one set of rules would have done in one sample. It is memory, not evidence.

This does not make optimisation wrong. You cannot test a moving average without choosing a length. Some tuning is unavoidable and some of it is genuinely informative. The problem is not the first parameter. It is the eleventh, added after the tenth failed to produce the picture you wanted.

The Moment Tuning Becomes Decoration

THE DISTINCTION

Research

Gold behaves differently in the first hour of London than in the New York afternoon, and my entries were being taken in the hour that does not suit them.The parameter change is a consequence of something you now believe about the market.

Decoration

Fifty-five worked better than fifty.The idea is unchanged. You have kept a coincidence because the software reported it.
Research changes an idea. Decoration changes a number.

Research changes an idea. Decoration changes a number.

That is the whole distinction, and you can apply it in one sentence. After a round of optimisation, write down what you now believe about the market that you did not believe before you started. If you can write something real — gold behaves differently in the first hour of London than in the New York afternoon, and my entries were being taken in the hour that does not suit them — you have learned something, and the parameter change is a consequence of the learning. If the only thing you learned is that fifty-five worked better than fifty, you decorated a history rather than researched a market.

There are three tells, and they usually arrive together.

The first is that the parameter count keeps rising while the idea stays the same. The strategy from three weeks ago and the strategy today make the same claim about why price moves. It just has four more conditions bolted to it.

The second is an improvement you cannot explain. The result got better and you have no account of why, beyond the fact that the software says so. An improvement without an explanation is a coincidence you have chosen to keep.

The third is the arrival of exceptions. Skip Wednesdays. Ignore August. Do not trade the week of a rate decision unless the previous week closed up. Each exception is a patch over a stretch of history where the idea did not work, and each one is a place where you have memorised the sample.

There is also a structural clue. Look at how the result behaves around the parameter rather than at the parameter itself. If fifty-two and fifty-eight are mediocre and fifty-five is excellent, you have found a spike in one sample. Behaviour that is real tends to produce a plateau: a broad band of settings that all work acceptably, with the middle only slightly better than the edges. A spike is a fingerprint of noise. A plateau is a weaker claim and a more honest one.

THE TELLS

01More dials, same ideaThe strategy makes the same claim about why price moves as it did three weeks ago. It just has four more conditions bolted to it.
02An improvement you cannot explainThe result got better and you have no account of why, beyond the fact that the software says so.
03Exceptions start arrivingSkip Wednesdays. Ignore August. Each exception patches a stretch of history where the idea did not work.
04A spike, not a plateauIf the settings either side are mediocre and one is excellent, you have found a fingerprint of noise in one sample.
Four signs that the tuning has stopped teaching you anything.

Keeping Data You Have Not Spent

THE CHECK

01 · SPLITDivide before you startDecide the split by calendar, not by how the periods look. Tune on the first portion only.
02 · TUNEDo the work in-sampleAdjust, test and argue with the idea inside the portion you have already agreed to spend.
03 · SPENDLook onceRun the held-back period and judge whether the behaviour survived, not whether a number was hit. Looking again spends it twice.
04 · FORWARDTest on data that does not exist yetForward testing is slower and it is the only sample that cannot be fitted to at all.
The order is the point: a check you run after tuning is not a check if you tune again afterwards.

The check that exposes decoration is simple and almost nobody does it properly, because doing it properly costs you something before you have any results.

Split the history before you start. Decide the split by calendar, not by how the periods look. Tune on the first portion. Leave the second portion untouched. The held-back data is the only asset in this process you cannot manufacture, and you spend it by looking at it. Look once. If you tune, look, tune again and look again, the held-back period has quietly become part of your tuning set and you no longer have a check at all.

When you do look, judge the right thing. The out-of-sample stretch will almost certainly look worse than the stretch you tuned on. That is normal and it is not the test. The test is whether the behaviour survived. Did the strategy take recognisably the same kind of trades? Did it lose in the conditions you would expect it to lose in, or in conditions that make no sense? Did the shape of the thing hold, even at a lower quality? A strategy that degrades gently is describing something. A strategy that falls apart and starts taking trades you do not recognise was describing one sample.

Two honest caveats. A short held-back period tells you very little, so a split that leaves you a handful of trades on the other side is a ritual, not a check. And when the out-of-sample stretch fails, the one thing you must not do is go back and re-tune on it. That converts your only independent data into more in-sample data and leaves you with a prettier history and no idea. Go back to the idea instead, or drop it.

After that comes forward testing, where the data does not exist yet and cannot be fitted to at all. It is slower and it is the only sample that is genuinely clean.

Writing The Rules Where They Can Be Checked Later

All of this depends on knowing exactly what you tested, which is harder than it sounds when the rules live in your head and change slightly every time you run them.

The strategies area of the MMFX member app is where a strategy gets written down as a fixed thing: the conditions, the parameters, the session the rules may fire in, and the management rules. Treat each written version as the object under test. If you change a number, you are testing a new version, and the old result belongs to the old version. That single habit removes most of the quiet drift that makes curve fitting invisible.

It also forces an admission people avoid. Management rules are parameters too. Break-even triggers, partial profits, trailing and scaling all have numbers in them, and those numbers can be fitted to a sample exactly as easily as an entry threshold can. A strategy whose entry logic is stable but whose break-even trigger has been moved five times is still being curve fitted. Trade management belongs inside the written strategy so that it is counted, reviewed and tested alongside everything else — not treated as a free adjustment you make on the day.

Finally, keep the written strategy attached to the routine you actually run: mark, bias, classify, wait, confirm, execute, manage, journal. The journal entry is what tells you later whether the live behaviour resembled the tested behaviour. Without that record, every future review starts from memory, and memory is the one sample that fits itself perfectly.

Trading carries risk of loss. Every decision you take is your own, and nothing on this page is financial advice.

IN THE MEMBER APP

01One written versionThe strategies area holds the conditions, parameters and session the rules may fire in. Change a number and you are testing a new version.
02Management counts as parametersBreak-even triggers, partial profits, trailing and scaling have numbers in them, so they belong inside the written strategy.
03Attached to the routineMark, bias, classify, wait, confirm, execute, manage, journal — the journal entry is what tells you later whether live behaviour resembled the tested behaviour.
Writing the strategy down is what makes the drift visible.

Keep reading

All guides →

Strategies

See it working on today’s market.

Fully-coded TradingView strategy scripts — entries, exits and risk encoded, backtested on gold.

← All guides