Backtesting is a tremendously valuable tool for testing a strategy and developing confidence in it. But it's very easy to do it wrong