Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Coefficient Help

Hello everyone,

Here is my dilemma, I am working on an algo that looks at bollinger bands and a couple SMA crosses. I want to know what combinations of standard deviations and SMA lengths work best. Is it possible to set up the backtester so I can run multiple test with many different combinations to generate a bunch of results and see what combinations work the best??

Thanks so much,

D

2 responses

You can't do it easily in backtester, I think there is some research code floating around here that will let you do it... But even if you could you shouldn't do that. Lets say you backtest over 10 years and find the perfect settings that give you the most profit with no drawdown. There is absolutely no guarantee that those parameters will still work in the future, What worked yesterday could be the worst tomorow. That's called overfitting, a form of bias that will cause your backtests to lie to you.

I usually just set my parameters to something that works fairly well in a wide range, ie if a parameter is good at 20 and bad at 19 or 21 I don't use it, if it's good from 15-25 I will probably set it to 20 and not touch it again. The exception to this rule is if a parameter is based on machine learning or some other dynamic selection method.

Hi Luke,

Thanks so much. I will have a look for the research code for pure interest but will not use it in the way I was intending. Thanks for the info on the overfitting bias. That really helps as I am quite new to this!