The benefit of backtesting

in #trading6 years ago (edited)

Yes, I know backtesting is boring, but it's absolutely critical to measure statistics of your system before you commit any real money to the market.

The only way to make money in the market is to have a system that is profitable over a long period of time. In other words, your system needs to have a statistical probability of success.

Much like a casino, you need to have an edge and then exploit that edge over time to make consistent profits. I can't emphasise the phrase "over time" enough...

Consider the following example, a very simple mechanical system that roughly doubles your capital over a period of one year. Ok, so you're not going to be rushing out to buy that Ferrari just yet, but with compound interest 100% soon becomes 200%, 400%, 800% etc... This system would be ideal for a pension fund, solid steady growth with low risk.

Starting capital $1000, roughly doubles per year (2 years data shown with original capital for analysis, no compounding)

back1.jpg

The beauty of backtesting is you can simulate drawdowns that you wouldn't see if you were testing the system in the real world. Look at the chart below, what if you had started to test your system in the middle of May (red area) ? You would think the system was complete garbage and probably abandon it, not realising it was actually profitable over time.

back2.jpg

The inverse is also true of course, take a completely garbage system that loses all day long but happen to strike a run of good trades at the start. If you started this one at the beginning of Feb you'd be planning your retirement after one week.

back3.jpg

The added bonus to backtesting is you can analyze the results to see if your system can be improved. In the first system with the big drawdown, you can go back and see what the underlying market was doing at the time. Was the market ranging for a long time and your system suits a trending market instead ? Was there a stormy period in world finances that meant you should have stayed out the market during that period or switched to a more suitable system for those conditions ?

Backtesting a system doesn't guarantee by any means that your system will be profitable in the future, but testing it on historical data, a lot of historical data, will give you the best information possible before risking real money.

Disclaimer : If you blindly act on the advice of strangers from the internet then you're an idiot and probably deserve to lose all your money. There's no fast track to success. Do your own research and make informed decisions based on all available evidence. Critical thinking is the key to everything.

Sort:  

My problem with backtesting is that the data (historical), do not account for the liquidity. So the backtest for your Algo, will always assume when you want to buy or sell, and the price is on the chart, the txn is successfully executed. In real life, that may not be the case.

Yeah backtesting has its pitfalls, but it's a million times better than testing in the real market and losing money when it could be avoided. Usually you can tell right away from backtesting if a system is clearly bunk or not, it's usually fairly evident from the start.

Another downside to backtesting is the emotional angle, and how strict you are at following your system, cutting trades early, making rash decisions etc.

People have used algorithm auto-trading with robots that demonstrated great results with backtesting, but they all eventually fail

I don't use algos myself but I do use a system. If the system gives me a buy or sell indication then that's all it does, indicate. I still make the decision whether to enter or not based on what the market is actually doing at the time.

However, if I test a new system on the last month of data and it completely bombs then I know that had I traded that system with real money then I'd be on a net loss. That's the point of backtesting, sorting out the clearly rubbish systems from ones that have potential.

No system works forever all the time, but some work better in some conditions than others or over shorter periods, backtesting is helpful at telling you that, there is no holy grail...

I was on a demo account for 18 months learning and practicing a strategy. I've tried backtesting before but found how rigid the charts were and the inability to make decent markings on them somewhat inhibiting.

I always recommend to people who want to get into trading that they go onto a demo account for at least 6 months while they work out how the markets operate and so that they can practice with strategies without losing any money.

Problem is that it takes too long and people would rather put their money in immediately and rely on indicators that only work 20% of the time.

Yeah, good advice. Here's my basic system >
Come up with an 'idea'
Backtest the idea at least over a 100 trades or so
Modify, tweek and repeat until happy.
Forward test the system using live data in a demo account until I've doubled the account.
Use it on my real account.

Seems like a lot of work, but it works for me...

I think a lot of traders get lost and fail to understand the statistics behind investing. Understanding the statistics involved in investing or even gambling can help the investor maximize short term trends as well as avoid short term over reactions.

I know. As weird as it sounds, I sometime find myself long and short on the same stock at the same time, just different timeframes lol. Most people can't get their heads around that :-)

Agree, but after backtesting, the next step is to forward test.

True, I probably spend 90% of my time back and forward testing whilst working.

If I'm not trading or waiting for something to happen during the day, then I'm using my simulator or a demo account to practise on.

No different from Tiger Woods hitting 10,000 golf balls when he's not playing a real game, you still need the practise !

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.028
BTC 65780.00
ETH 3522.63
USDT 1.00
SBD 2.47