Dear friends,

I have been following tradingqna since long. And learned many things from all the traders friends here.

Need to learn and discuss various back testing techniques either through any system/softwares or manually used by traders in today’s world. It would be great if @Abid_Hassan @nithin and @Karthik also can contribute to this topic.

Regards

Backtesting is an integral part of building a trading strategy. It essentially gives you insights into your trading logic and helps you understand how the strategy has behaved in the past.

Assume you have a super simple strategy - Buy when 9 days EMA crosses over 21 days EMA and sell when the opposite happens. Once you define your strategy, you will have to select a look back period. Look back period could be 6 months, a year, 2, or 5…or 5+ years.

After you select the look-back period, you will essentially have to identify how many times in the past has the 9 EMA has crossed 21 days EMA. Or in other words, figure out how many times in the past your strategy has worked. You can either do this manually or do this programmatically.

The results you need to note are -

- How many signals were generated (buy and sell)
- Average holding period per signal
- Overall profitability after adjusting for transaction costs
- How many of the buys were successful and how many sells were successful
- What was the average profit % per win
- What was the average loss per loss
- How many consecutive winning streak
- How many consecutive losing streak

The above-mentioned points give your various insights - the list can get exhaustive, but what I’ve mentioned here are few essential metrics.

Good luck!

3 Likes

Sounds very useful. Thanks a ton

1 Like