FRENESDE

Optimizing parameters without fooling yourself

Optimizing means testing several values of a parameter (for example the length of a moving average: 20, 30… 80 days) to see which gave the best historical result. Useful but tricky: the best past is not the best future.
Look for a plateau: a zone where several neighbouring values give similar results. Here, from 40 to 70 days, Sharpe stays between 0.8 and 1.0: the rule does not depend on one precise setting.
An isolated spike (1.9 at 40 days, almost nothing at 30 and 50) is a warning sign: you have probably found luck. The more combinations you test, the more likely you find a spike by chance: this is data mining.
Calculation: at a 5% threshold, testing 100 combinations with no real edge gives on average 100 × 0.05 = 5 "winners" by pure chance. Count your trials, pick the centre of the plateau, then validate on data the optimization never saw.

Examples

Key terms

Parameter
Numeric setting of a rule (period, threshold, stop distance)
Optimization
Searching for the parameter values that gave the best past result
Plateau
Zone of neighbouring parameters with similar results
Data mining
Testing so many ideas that one ends up working by chance
Take the mission on Doji Academy

← Back to the index