Brute Force Optimizations

Here’s a question from Matt H. (name used with permission):


Matt H.

How do you optimize things like the gap %, how long a moving average period value should be or other variables that might make sense in an automated guess and check scenario? Running a backtest takes a couple of minutes, but running an optimization (in Amibroker or TradeStation) can take hours or days.


Dave:

Optimizations in tools like Amibroker, TradeStation, or NinjaTrader are what I consider brute force optimizers.

If you’re planning on living for several centuries, they’re not bad. Otherwise, these tools are a waste of time.

(This is no exaggeration. Try brute force optimizing 200+ columns in a backtest. It will take at least a century to complete, but the Strategy Cruncher will do it in seconds.)

Gap percent is very different than the moving average period value.

Add Gap percent to your column library, and the cruncher will let you know when it’s predictive for any strategy you run it on.

The moving average period value is different. If the moving average is being used in your strategy’s signal, then I’d use the approach I mentioned yesterday: pick 3-4 combos and run backtests for all of them to pick your values.

If the moving average values you’re referring to are for columns in your backtest to potentially filter on, then I would pick ~3 different values and add them each as columns.

I have different values like this in my column library that I label:

  • Long
  • Medium
  • Short

There won’t be a single, magical value for the moving average period that will make or break your strategy.

In fact, if there is a specific value for the period that is significantly better than adjacent values, that would worry me!

-Dave

P.S. Are you interested in using Amibroker for backtesting? I’m putting the final touches on a course on Amibroker that shows how traders who actually trade for their income use it. Click here to sign up to be notified when it’s available: