tag:blogger.com,1999:blog-5108179989881744725.post5046677802129362068..comments2023-12-13T04:12:08.163-08:00Comments on Trading with Python: Backtesting dilemmassjevhttp://www.blogger.com/profile/17452562180989360928noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5108179989881744725.post-41524213761891737392014-09-14T21:48:47.648-07:002014-09-14T21:48:47.648-07:00Did you look at bt - Flexible Backtesting for Pyth...Did you look at bt - Flexible Backtesting for Python ?<br />http://pmorissette.github.io/bt/High Handhttps://www.blogger.com/profile/00510652333484013277noreply@blogger.comtag:blogger.com,1999:blog-5108179989881744725.post-37030722538478997572014-06-13T11:05:00.380-07:002014-06-13T11:05:00.380-07:00Ken, thank you for your insightful comments.
Your ...Ken, thank you for your insightful comments.<br />Your guess is correct that I'll be 'home-brewing' as in the meantime I've found pybacktest not to be a solution I really look for. My idea now is to build on good ideas from pybacktest towards a framework that overcomes current limitations.<br />I'd like to do it vector-based for performance and code simplicity. Your concern about the look-forward bias can be addressed with good code testing. sjevhttps://www.blogger.com/profile/17452562180989360928noreply@blogger.comtag:blogger.com,1999:blog-5108179989881744725.post-58644737104295890202014-06-11T19:34:47.086-07:002014-06-11T19:34:47.086-07:00While I'm a fan of zipline, I concur with your...While I'm a fan of zipline, I concur with your speed comments and have witnessed as much. PyAlgotrade, also event-driven, I concur is significantly faster, I assume with much less bells/whistles than zipline? not sure - no free lunch though.<br /><br />Crunching on the dataset as one pandas df is certainly always the quickest when coded properly, as is the framework used with pybacktest. I'm certain you'll find this the fastest; but, note the current implementation is single security, not portfolio. Ideally, we optimize over a portfolio, not a security.<br /><br />I have a hunch you'll be home-brewing, but we'll see what you think; that is, unless you want to try out commercial solutions.<br /><br />A final comment, is that even though processing a df all at once is most efficient, I find myself leaning towards event-driven solutions if only to be 100% certain of no look-ahead bias, or at least minimize the possibility. They also mimic the real world best, can handle rollover situations,etc. Perhaps the parameter scans investigations you mention, etc. would be best suited for df-level; but, back up with a confirmation with an even-driven tool.<br /><br />I look forward to your future posts.Anonymoushttps://www.blogger.com/profile/00405525187765480389noreply@blogger.com