-
Notifications
You must be signed in to change notification settings - Fork 259
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
bar_event squashes price_event price #249
Comments
It looks like if I swap the order add_price_event() and add_bar_event(), things work better. Digging into the code a bit, it initially looks like the final_prices are getting squashed here: (BacktestController.py, line 418)
My initial testing shows that the following code preserves all prices @ all resolutions:
I'm not super familiar with enough of the code to understand what impact this could cause, but if there are tests I can run against it just let me know. Going to keep testing to see if it breaks anything else that I can see. |
Description
If you add both a bar_event and price_event, the bar_event's resolution impacts the price_event's price. For example, if I have a bar_event that is triggered at a resolution of 15m, and a price_event with a resolution of 1m, then the price_event will be triggered every 1m, but the price will only change at 15m thresholds.
Output:
If I comment the add_bar_event() out, or simply change the resolution to 1m (matches price_event) then it works fine:
So is this an issue, or is my implementation/assumption incorrect?
The text was updated successfully, but these errors were encountered: