-
Notifications
You must be signed in to change notification settings - Fork 271
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
state.interface.history
should return history at state time during backtest
#64
Comments
Hmmm I thought we had it working with the backtest times but I must have missed something. Something that may help with your workaround as I patch this is you can use This can be used like this: state.variables['history'] = state.interface.history(symbol, to=150, return_as='deque', end_date=state.time)['close'] ^ Just added the Thanks for opening the issue! |
Ah nice, thanks for the reply! Didn't know you could combine I'm using the pypi package, version 1.11.2b0 if that helps. |
Just pushed out a new release. On the backend this is filling in |
It works! 👍 Thanks :) |
Hey @mariushelf! I know this is really late! Hope you've been well as we've been actively grinding and shooting out updates! Would love for you to join our discord man and try out our new platform |
Description
state.interface.history should return history at state time during backtest.
At the moment, when called in an
init
function at the beginning of the backtest, it retrieves history relative to wall time.Example:
The backtest goes from 2020-01-01 to 2020-12-31. When retrieving 5 days of history I'd expect it to get 2019-12-26 to 2019-12-31.
Instead it gets the last 5 days relative to the day when it is run, e.g., 2021-10-24 - 2021-10-29.
As a workaround I'm using something like this now:
settings.json
backtest.json (if applicable)
Platform Info
The text was updated successfully, but these errors were encountered: