Wednesday 12 October 2011

Backtesting

Backtesting is an operation that requires quite a lot of consideration before you start.

Firstly, what exactly are you backtesting for? Backtesting or optimisation can be just an exercise in curve fitting if the process is not carried out correctly. The definition of the entry picture and trigger is one issue, but the more importantly for backtesting are the exits, both stops and targets.

How you exit really determines the robustness of your algo. Volatility is changing day to day and hour to hour. Expecting a measured best target and stop to survive these changes in volatility and still leave you consistently profitable is a big ask.



Targets and stops need to be engineered to fit market activity. Yes, a hard wired stop and a hard wired target has a place in testing but only at the very preliminary stage when the entry is being validated. After that point, specific market related exits, both stops and targets, need to be engineered in order to add robustness to the algo.



These comments apply to a fully automatic algo, not to a hybrid (manual trade management) algo. Trading hybrid is easier in terms of algo creation than trading fully automatic. Also, a hybrid trader should make a lot more money as a percentage of drawdown than a fully automated algo. Of course, fully automated has other advantages to balance this disadvantage, the main one being that you don't have to sit there and make decisions. The key to hybrid trading is to backtest in order to find a high win rate first (or all) profitable scale out point and build on that with your trade management.


Patience paid off this morning in the DAX. The idea is to design your TP to catch the trades you want. Using an algo forces this discipline by requiring me to be very specific in my entries. I can still muck up the exits, but I fight that by scaling out. The MultiCharts algo can be fully automated. My MarketDelta algos are still under construction. I have them working as markers signaling trades at the moment and am working towards automation.




The chart below shows the ES signals on the MarketDelta chart. The first pullback was a losing trade. I was waking up and missed them. The next two trades were scratches and the third took off. Using an algo, even for alerts, validates trading pictures and makes sure I don't miss too many trades.




4 comments:

  1. Tom, how far back do you like to backtest for intraday trading?

    Do you find backtesting for say only the past 5 days gives you pretty accurate data for the most recent level of volatility? Or do you find going further back in time to say 20 days is more accurate since its based on more data?

    ReplyDelete
  2. Kyle, its not how long but "how". Backtesting is a very complex operation if you want to get results that are meaningful and useful. That's one of the reasons for the Workshop. It can't be taught in a blog. If you have optimised over normal days and get a trend day then you'll probably lose. If you optimise for a volatility of X and today's volatility is less then your targets may not be hit. Sorry there is no short answer.

    ReplyDelete
  3. Hello,

    When you say "high win rate," do you mean greater than 70%?

    ReplyDelete
  4. Anon 18:00, Let's say greater than about 70%. It can be a bit less if there are compensating metrics.

    ReplyDelete