Do not optimise for profit
This is the single most consequential choice and almost everyone gets it wrong. Ranking candidates by total profit or by profit factor will crown a configuration that made its money in one exceptional trade, or that took a drawdown you could never have sat through, or that produced eight trades in total.
A better objective combines several things at once: how large the average trade was relative to its variability, how many trades support the result, and how much drawdown was suffered getting there. That mixture asks a different question — not "how much did it make" but "how sure are we this is not noise, and what did it cost to find out".
A specific refinement worth knowing: when measuring variability, divide by the deviation of the losses alone rather than of all trades. Dividing by the deviation of everything penalises large winning trades, which means the search actively rates down the exact behaviour that makes trend strategies profitable.
Use a coarse grid
It is tempting to test every value in fine increments. Resist it. A fine grid finds sharper peaks, and sharper peaks are more likely to be artefacts of that particular sample than real behaviour.
A coarse grid tests fewer combinations, which reduces the number of chances the search gets to fit noise, and the peaks it finds are wide enough to be plausible. If a strategy needs a period of exactly 21 and fails at 20 and 22, it does not have an edge — it has a coincidence.
Judge on data you did not fit on
Rank candidates using the fitting window, then take only the top handful forward and score them on a window they never touched. Carrying every candidate through would turn the second window into just another thing to overfit against.
Only the out-of-sample score is allowed to decide anything. The in-sample number's only use is deciding which candidates are worth the cost of judging.
Check the neighbourhood before adopting
When a winner emerges, score the parameter values one step away on each axis. If the winner is profitable and its neighbours are too, you have a plateau — the surface is smooth and the peak sits on raised ground. If the winner is profitable and its neighbours lose, you have a spike.
A spike is not an edge. It is the one parameter value whose entries happened to align with this sequence of prices, and the next sequence will put it somewhere else. We treat that as a veto, and the reason is a concrete one: a configuration that passed every other gate — out-of-sample profit factor 1.474 — ran at 0.518 live. Its neighbourhood was never profitable.
Move one parameter at a time. Moving two together tests a configuration the search never considered and mostly measures how far you went.
How often to re-optimise
Less often than instinct suggests. Re-tuning after every drawdown means chasing whatever worked most recently, which is a way of guaranteeing you are always fitted to the period that just ended.
If you do re-optimise automatically, require the new configuration to beat the running one by a margin rather than by a hair, and require it on enough trades to mean something. A system that switches settings on a rounding difference will churn constantly and never accumulate the sample it needs to know whether anything works.
It is entirely reasonable to conclude that a strategy should not be re-optimised at all — that its parameters are what they are and the market decides the rest. Standing still is a valid outcome and is what stops a system chasing noise.
Common questions
What should I optimise a trading strategy for?
Not raw profit. Combine the size of the average trade relative to its variability, the number of trades supporting the result, and the drawdown suffered. Optimising for profit alone crowns configurations that got lucky once.
How do I avoid overfitting when optimising?
Use a coarse parameter grid, judge candidates only on data they were not fitted to, check that nearby parameter values also work, and re-optimise rarely. The neighbourhood check is the one most people skip and it catches what out-of-sample testing misses.
How often should I re-optimise?
Rarely. Re-tuning after every drawdown fits the strategy to whatever just happened. If re-optimising automatically, require a clear margin over the running configuration and enough trades to be meaningful.
What is a robustness check?
Scoring the parameter settings one step either side of a winner. A real edge is a plateau where nearby settings also work; an artefact is a lone spike, and that is the distinction the check exists to draw.
Trading carries risk and you can lose money. Nothing on this page is financial advice. Past performance does not indicate future results.
