Ventures of an ex indie game developer

How to optimize your backtesting

My recommendations for optimizing your margin trading bot's performance are:
  1. Optimize for Sharpe ratio (not for gains);
  2. Optimize your weak spots according to price history (not your strong gains).
The reasons are very simple. When optimizing your result for Sharpe ratio, you'll find steady gains. Steady wins over rush-pullback in the long run. The weak spots are what kill you in margin trading. Optimizing these ensure you don't get rekt.

The optimizing pseudo code goes something like this:
P = initial backtesting parameters
main_loop:
    parameters P1 = randomize or gradient from P
    funds_over_time = backtest using P1
    sharpes = split funds_over_time into N slices and calc sharpe
    if minimum sharpes > best_sharpes:
        best_sharpes = minimum sharpes
    goto main_loop
With this you can't possibly go wrong. And can that quantum trading idea you heard about - this is a gazillion times better!

About the author

Mitt foto
Gothenburg, Sweden