Skip to content
All library documents

Avoiding Curve Fitting in Standard Deviation Band Strategies

Article Quant Q&A · Author: olsen yersen

Summary

The document asks how to optimize a trading strategy using standard deviation bands on detrended prices, potentially with a neural network or genetic algorithm. The response says optimization requires explicit choices of parameters, such as band count and trendline slope, plus a defined profit objective. It warns that selecting parameters solely to maximize historical performance can produce a curve-fitted strategy that fails out of sample, especially when there is no theory for the chosen inputs or their relationship to returns.

The answer also points out that the strategy’s premise is unclear: trading band breaks might represent trend following or mean reversion, which require different explanations. It recommends first observing market behavior and forming a model of the process that could generate it, then fitting a strategy to that theory. A standard deviation calculation is briefly described in a second response, but the document does not provide a tested band strategy, optimization procedure, or empirical results supporting profitability.

Key ideas

  • Define the parameters and profit objective before optimizing a band strategy.
  • Historical optimization can overfit and fail to generalize to future data.
  • Clarify whether band signals represent trend following or mean reversion.
  • Build a market explanation from empirical observations before fitting model parameters.
  • The document provides no validated trading rules or performance evidence.

Tags

Full text
# How to calculate optimal standard deviation bands for trading?


# How to calculate optimal standard deviation bands for trading?












I am trading with standard deviation bands (6 bands) on de-trended data. How can I find the most profitable signals with neural network or GA with standard deviation bands? Should I first find the slope degree of n bars of trend line (for example, 50 bars linear trend line slope is 30 degree) then calculate bands distance to price the finally find the probability distribution of the signals? Is this the correct method? Any comments welcome from people with a good grasp of signal processing and knowledge of probability.

## Answer by Ram Ahluwalia (score 5)

https://quant.stackexchange.com/a/1753

You need to define the parameters over which you are searching (i.e. # of bands, slope of trendline, some function relating slopes to trendline, etc.). Then you can use your favorite optimizer to identify which parameters satisfy your P&L objective.

Of course, your approach is a surefire way to lose money since this curve-fitted model will not generalize out-of-time. There is no theoretical reasoning on why the parameters and functional form that your optimizer identifies need explain future returns. It's also not clear what your strategy is -- trend-following or mean-reversion on breaks -- which suggests there is not much of a theoretical underpinning here.

A better approach along your lines of going long/short and certain bands would be the attached paper by Marco Avellaneda @ NYU. Better still is taking a step back and making empirical observations about the market and then fitting a theory (what statisticians call the "data generating process") to explain your observations. Then try to build a model that reflects your theory.

## Answer by Katie Simone (score 0)

https://quant.stackexchange.com/a/4355

Calculating standard deviation is a little bit complex. Standard deviation is used for prediction from past data. For calculating it firstly calculate mean of group of data, than subtract mean from each data, take square of each result and create sum, than divide this by the total number of data minus one. The sum of all the squared differences is then divided this by number less than total data. The square root of this number is called standard deviation.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.