Page 1 of 1

Speeding up backtest & optimization w/ hybrid bar intervals

Posted: 04 Jul 2016
by fbertram
I am working on a strategy that - for the most part - emits trades once a day. Unfortunately, these trades happen at the beginning of the session, so I can't use daily bars.

Instead of simulating with 5 minute bars and taking a huge hit in processing time, I am using a hybrid bar interval, with 3 bars per day:
* 9:35 - the 1st 5 minutes of the session
* 9:40 - the 2nd 5 minutes of the session
* 16:00 - everything from 9:40 to the end of the session

This allows me to simulate quickly while maintaining the intended accuracy. I have attached a little C program that converts 5 minute bars to the format mentioned before. It should be mostly self-explanatory and easy to tailor to your specific needs.

Cheers, Felix