3

I'm current developing an event-driven backtesting engine in Python. I would like to have an idea about how fast a high speed backtesting engine should be, especially in Python. Right now, I can replay one year of 1 min bar data about 10 hours.Is it fair to say the speed now is acceptable?

I know there are some open source backtesting engine on Github, like Pipline. I don't really know whether it is event-driven , because I did not play around with it before.

Anyone has a good idea of how fast a good quality event driven backtesting engine should be ? Thank you so much for your help.

SimonZ
  • 31
  • 1
  • Why not just use [pandas](http://pandas.pydata.org) (even tho it would be vectorized not event driven). Is there any good reason to create a new engine from scratch? As for the question.. It is too broad, the only way to measure speed is comparing it to other alternatives (such as pandas or pipline). – Imanol Luengo Aug 24 '16 at 15:45
  • Thanks for the reply. The reason for using a event-driven framework is allowing you to switch from simulation to production easily. Pandas is great. I used a lot of features of Pandas in my engine to speed things up. – SimonZ Aug 25 '16 at 19:36

1 Answers1

1

That's terribly slow. I run backtest on 350k+ min bars, including multiple signal generations, portfolio optimization, rebalancing, and execution priority algorithm, in around 40 mins. Pure python, no pandas, jit, or cython.

IMO, it will depend a lot on the level of sophistication and complexity on the many of your moving parts.

Samuel Utomo
  • 131
  • 1
  • 4
  • This sounds incredibly realistic. The moment there's database connections and live training involved (machine learning) this timing explodes. People should be realistic. The results will come slower than normal vectorized backtest usually. – Kivo360 Sep 03 '19 at 05:03