-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New features : Intraday #70
Comments
I am interested in the same feature. Feels like this project is dormant |
Hey @arita37, @macgyver13, First off, sorry for not responding earlier. I have been extremely busy with work and a young child at home. I personally don't backtest at the intraday level, but as @arita37 said, it shouldn't be too difficult - most of the heavy lifting is done by pandas. You would just need add some Algos - for example, RunHourly, RunEveryXMinutes, etc. Some of the performance metrics assume daily frequency as well, so that would have to be tweaked. Also, intraday frequency brings on a whole other set of considerations. What about slippage costs, market impact, timing, etc? This would have to be factored in if you want accurate simulations. Anyways, I hope this helps and I apologize for the lack of commits on this project - such is life! Cheers, |
I understand how life goes, I have a lot less time to develop than in the I am trying to determine best way to process reference daily statistics and Any confirmation or advice would be great. Do you know of better Thank you On Wed, Oct 12, 2016 at 9:50 PM, Philippe Morissette <
|
Hey Ron, Yes basically most of the framework would be fine as is. Look at the RunMonthly algo for an example. It looks to see if the current month is different than the month the last time the algo was called. If so, it returns True, which essentially allows execution to continue. If false, the AlgoStack stops execution at that point. You could apply the same logic at the intraday level. Another interesting algo is Rebalance if you want to see how the actual allocation of capital is done. I developed bt for longer term portfolio style strategies, where you are essentially rebalancing / shifting weights between different assets. The general pattern is Select -> Weigh -> Rebalance. So, Select figures out which securities should be in the portfolio, Weigh determines their weights (equal weight, min var., etc.) and Rebalance does just that. You could do the same on a smaller time scale - basically, your algo would determine which securities should have some allocation (x% of your portfolio, or whatever logic you choose to apply). I haven't really looked at any of the other frameworks in a really long time so I can't give you good advice. The only other Python one I am familiar with would be Zipline, although I haven't used it myself. It powers the website Quantopian, which does support intraday out of the box (I think). Hope this helps, |
+1 intraday would be a great feature, ffn is easy, all you have to do is resample the intraday equity to daily with pandas, like:
bt would be a bit trickier, not sure I could do it without breaking it's natural flow. |
I added an abstract class RunPeriod that can be derived from to handle intraday time frames. Check out the code. If you wanted RunHourly, it would look something like the code below:
|
Thanks a lot for the hourly intraday code! May I ask you if that code snippet works for you? I would also be interested in running intraday strategies! Thank you |
Hi,
Just wondering if we can 'twist' the existing class to put intraday data ?
Think this should be the same, just more timestamp.
Thanks
PS: do you have an email where we discuss on this ?
The text was updated successfully, but these errors were encountered: