How do you backtest?

I know quite well how important backtesting is. How do you backtest the market? What’s your technique?

3 Likes

First of all, I’m not an expert in this backtesting stuff but if I were to backtest my own strategy, what I want to see is the flaws of my strategy so that I can generally avoid that during my live trading. I also need to be aware of what market state that I am currently in during my backtest so that I don’t simply judge the strategy wouldn’t work if it generates poor stats. This information also might help me to reflect on what’s the strategy weaknesses and find a solution of how to improve the strategy.

But, at the same time, I also need to bare in mind that these past performance doesn’t always represent future result. Many people done backtest and achieved positive result so they immediately translate this result should reflect exactly in live market which is not true. Personally, I wouldn’t waste so much time on backtesting because I did it in the past but I feel like it didn’t do much help on my trading (It might because of I was still new and didn’t know how to use this tool correctly maybe). I still remember doing it back in my early days, keep changing this and that, tweak this and that value. Wasting lots of time doing these crap (my personal experience though. Whether you think is good or not it’s totally up to you).

What I rather be doing if I were going back in time is to practice on a live market even more using a demo account. Putting 500% my effort in practice instead of just 100%. And then take the time to reflect on what I did. More like a sportman way of improving his/her craft. Without practice, I wouldn’t be able to improve my performance.

Also, I need to have an understanding of what my strategy should do in a nutshell. Trend pullback? breakout? etc. Many people putting bunch of indicators on their screen until they can’t even see what the actual price is doing and don’t have a single clue of what the indicator is for. Their chart looks like a rainbow chart kind of thing (LOL). When I see people have these kind of charts, I’m like… :rofl: :joy: But if it’s working them who am I to judge right? Hehe.

Anyway, I wish you good luck in your backtesting journey. Cheers!!

4 Likes

I highly doubt that someone will give a step-by-step guide how to back test properly. It is a lot of work when you do it from scratch. Two tips from me, there is no one technique to do it properly, the quality data is absolutely minimum which you need to have.

4 Likes

i strongly agree with Greg’s two tips, there - this is harder than it looks!

you can outsource it to an expert, but that’s hard, too, because you need to be able to judge who’s really an expert, and that’s not easy either

2 Likes

This is where I am lucky in that I am a computer programmer. I wrote my own back tester that gets the candlesticks from a broker (I can go back several years) and then rolls the strategy forwards to see how it performs. The best I can tell you is that back testing shows you what would have worked had you tried it back then. It does not tell you what will work tomorrow. A strategy that wins over the past 5000 candlesticks may lose when you run it over the past 1000 candlesticks and may win or lose over the next 1000 candlesticks. Basically, back testing does not tell you anything really except for the rough number of trades you are likely to make with the strategy you are using.

4 Likes

if you can extract only a number of trades, I think you don’t know how to do back test.

1 Like

I consider focusing on chart price action movements as being better, albeit what has happened in the past is no clue to the future.

I also look out for the 50 - 20 EMA in that a cross over is worth a check point. i was told by a USA pro trader that Americans consider 50 as being the pivot point.

It’s often told me a lot more than that.

If I’m looking at two different methods and run each through a decade’s tick data, and find that one has never had a losing year and the other has never had a winning year (and that’s an easily possible finding), I then know which one to research, investigate and develop further, and where to put my time and effort. That’s the value of backtesting, for me.

4 Likes

What put me off back testing was when I did a couple of experiments. I have access to 5000 daily candles for a bunch of pairs so I can go back a few years with my data. I did back testing on several strategies but what I did was to split my 5000 candles up into 300 candle chunks (roughly 1 year) and run back testing on each of those chunks. What I found out was that the same strategy would win one year and lose the next (no surprise really) and that the same strategy in the same year would win on some pairs and lose on others. Just for fun I added a couple of completely random strategies and back tested them. They turned out to be just as good as anything else.

3 Likes

Sure. Very common. Those are two groups I probably investigate no further.

Only thorough backtesting can help me to exclude them and to identify the very rare ones that are successful on most currency pairs in most years.

Personally, I need tick data for that, though.

5,000 daily candles, I must say, wouldn’t help me.

2 Likes

I use the Oanda API and I can get the last 5000 candles on any timeframe except weeks, for some reason they do not go back 100 years or so with their data :slight_smile:
What I do is as I advance to the next daily candle I look at the high and low to see if my SL or TP would have been triggered that day. If they both could have been triggered then I take the pessimistic view and assume that it was the SL. It is not as good as having the individual ticks but it gives you a pretty close approximation.

1 Like

on tradingview with the bar replay feature, paying the highest subscription for the most amount of bars. I scalp so I atleast want 100 trades minimum. Takes a long time but its worth it because if you do lose, your backtesting data gives you the confidence to keep using that strategy because no strat is 100% win rate

2 Likes

When it comes to Intraday or Short term trading, manual backtesting is impossible in most cases.
Fortunately I know little programming and we have MT5 strategy tester that is best in class.
So I program my strategies and test them on tick data. For Intraday trading strategies, I prefer at least 3 years of backtesting and drawdown no more than annual return.
I am here to help anyone if needed. I can code your Strategy for free for testing purpose.

1 Like

I use historical data and simulation tools to rigorously test trading strategies, assessing their performance and reliability before implementing them in live markets.

Hmmm, something I didn’t know was a benefit! Thanks for sharing that!

1 Like

So with that feature, are you still running the trades manually, like you’d imagine taking a trade at some price in the past, and you run the candlesticks forward to see what happens?

Or are you actually plugging trade entries into something, with the replay feature displays?

What’s the difference between tick data and say 1s bar data with open, high, low, close ? Is the tick data specific to a time-interval when you download it or get API access?

Backtesting is a long process so I think you should keep a personal trainer and he will guide you how to do it.

I’m pretty sure that to 99% of traders, and probably to 100% of retail traders, there’s absolutely no difference that’s relevant or significant at all.

I haven’t bought any for so long, that apart from maybe “it varies” it’s probably best if I just say “I don’t know,” sorry!

You can backtest any strategy by creating a trading view strategy for it, it not only gives you the backtest data in the particular currency pair or whatever asset you want to backtest on but also help you finding the setups in a very easy and convenient way