Backtest your strategy without losing your money
I decided to write up this little article because I’ve seen many questions around various forums regarding backtesting different systems and simulated trading. There seems to be a lot of confusion about reliability issues and how to go about performing backtesting so it can achieve accurate results. I am not a programming guru but I believe I can provide some guidance and easy options for the new traders , in particular.
However, I must also specify that on the long learning journey towards becoming a successful trader there’s no substitute for experience. A trader who has spent many months trading a live market will have a feel for the market that is almost impossible to explain.
Now, let’s answer some of the most common questions that a novice trader might have:
What is backtesting?
Backtesting is the process of applying a trading system/strategy to historical data in order to quantify how accurately the strategy or system is performing. Backtesting and trading simulations might be used as a learning tool before you start trading using a Demo account or trading with a real money.
By using backtesting and demo accounts you are indirectly saving your money (not losing money is often the first step to making money 🙂
Should I use Backtesting?
Good backtesting is important when considering a system-trading approach, because you want to have some idea of the feasibility of your idea before you go live with it. By putting your system to test using historical data you can estimate the performance of your system based on the underlying theory that any strategy that worked well in the past is likely to work well in the future, and conversely, any strategy that performed poorly in the past is likely to perform poorly in the future.
Backtesting is best suited to analytical traders, traders planning to use well defined trading system either manual or automated.
Discretionary traders are seeing backtesting as a waste of time and arguing that the live market is very different from looking back through charts or backtesting. When you backtest, you can see the bars that are coming, and there is no real stress involved. It’s easy to see what signals would have worked, and which ones did not. When it comes to trading for real, you can’t see what’s coming, and that is a very different dynamic indeed.
Backtesting for how long back?
I think it depends upon the type of strategy, the more trades per day and shorter time scale approach would probably need less time. For long term trending strategies for instance would expect need minimum of 100 in a range of market conditions to ensure less chance of surprises.
Manual Backtesting for ‘dummies’
The easiest way to perform backtesting without investing too much effort in learning programming of MT4 platform(or other trading platform) is to actually doing it manually using the charts on your broker’s platform and an excel spredsheet to record the results.
How to do it (note that the steps are written with MT4 platform in mind so not all might be applicable if you are using another charting software)
- set-up all your indicators on the chart you want to use for backtesting
- disable chart autoscroll
- scroll back the chart to the point where you want to start. Don’t peek while scrolling
- now you can play the chart bar by bar moving forward
- ‘trade’ according with your strategy (size of the position, levels for entry, exit, stop loss, target profit) and create a record in the spreadsheet for each ‘trade’
- calculate your profit or loss on a large sample of ‘trades’
Remember that you need also to include commissions or spreads, take into account the margin requirements and possible slippage assumptions. Spread and slippage, in particular, have strong influence on short term trading performance To get the most accurate backtesting results, it is important to tune these settings to mimic the broker that will be used when the system goes live.
Backtesting tools for advanced traders
Traders that wish to be more sophisticated and precise with backtesting their strategies can make use of professional platforms, such as Ninja, Tradestation, Zorro or use their coding skills and implement their system in MT4 platform.
If you don’t have the coding skills then it can take a long time to learn it. As an alternative you can find someone with the skills that can help you or pay for a professional platform that is easy to customise.
MT4 Platform you must use MQL language and you’ll need historical tick data. You can find free data on the web (search on “birt tick data” in your preferred search tool).
Tradestation platform offers several add-ons for backtesting and optimization. Still, you need to learn Easylanguage.
Backtesting is one of the important aspects of developing a trading strategy and when you want to use of automated trading. If performed and interpreted properly backtesting can help traders optimize and improve their strategies, find any technical or theoretical flaws, as well as gain confidence in their strategy before applying it to the real world markets.