T7 Wealth Creators
T7 Wealth Creators

Connecting Dots With A Backtester

Backtesting a trading idea with historical data, once it has been translated in to piece of code provides deep insight in to the idea performance. If something worked well in the past it is likely to work well in the future as well. But this is conditional and often it is seen that the backtester results don't tally well with the live trading results. Then we think where lies the problem ? Where to bust our head to solve the problem ?

Well, the answer is often simple. If the end didn't meet the expectation, we need to check the means to that end. Reliable backtesting is quite an involved process which needs one to have the grasp about real world market, data feeds, backtester engine capabilities and algorithmic coding.  Yet if we have to draw broad contours about backtesting these would be the points we would connect. 

    • Backtest with data containing variety of patterns - Bull market, bear market, volatile market, flat market with different instruments over a large period of time. A limited data sample set fails to test the all round system performance under a variety of conditions that a live market can present to the system. 

    • Don’t over optimise and curve fit to peak of profitability. Slight change in tested patterns (inevitable in live market) will push the system off the cliff. A system with a plateau of fairly decent profitability is likely to yield a much reliable performance in the long run compared to a system hanging off a cliff. 

    • Know the backtester limitations. Some backtesters confirm condition on current bar and trades on next bar open only. Some are more advanced. But always remember for any candle the backtester cannot know the intra bar movement. Looking in to history it only knows the OHLC values. So it has to make assumptions regarding the price movements. Also some back testers support margin based checking some don’t. Keep a watch over trade and maximum drawdowns also. Ideally the backtester should be able to trade the strategy as in real live market. A limited backtester often pops out false results which may not have much correlation to what will happen in live market. 

    • Data integrity is important. Splits / Bonus related price variations need to be accounted for. Data holes should be avoided. Real time data fetched during live market may also change after market due to data feed issues which also needs consideration.

    • Liquidity and circuit freeze issues should be factored in along with transaction costs.

    • Always ask - is it easy for me to execute trades using the strategy with backtester like discipline ? If not, the rules are complex and so live results are likely to deviate from backtester significantly.