-
Notifications
You must be signed in to change notification settings - Fork 543
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
Add indicator values to streamed feather files #1356
Comments
@cjdsellers I'm also interested in this enhancement. If I were to create a custom data type for indicator data, and publish that data to the MessageBus using publish_data, would that also result in .feather files containing the indicator data after a backtest run? Or are additional steps required? Thanks! |
@cjdsellers Revisiting this as I'm finding it important to stream / persist indicator values, so I can visually validate strategies. How would you think about implementing this? Is @cniqvtcfgt on the right track? |
Hi @cniqvtcfgt So the message bus and external publishing configured through If you're looking at the code then checkout |
This turned out to be simpler than I initially thought, especially if you're not looking to track too many indicator values. All I had to do was use For others' benefit, if you look at the The main limitation of this method is that To address this, I think @cniqvtcfgt's approach is correct. First, you create a custom data type, e.g. |
Potentially you could just pass a Otherwise what you describe sounds correct. |
Feature Request
After running a backtest, I'd like to be able to review and inspect all changes to indicator values. For example, I'd like to be able to plot the values from moving average indicators alongside prices and trades to get a wholistic view of the strategy. Using the default
StreamingConfig
settings and implementing a basic crossover strategy, like the EMA strategy in the project examples, the streamed feather files don't appear to include indicators.Separately, I noticed that the
.feather
files saved to the backtest catalog directory cannot be read usingpd.read_feather
orfeather.read_feather
, as I would have expected. I get the following error:ArrowInvalid: Not a Feather V1 or Arrow IPC file
.To read one of these feather files to a pandas DataFrame, I had to do the following :
Is that expected? If so, I think it would be helpful to either convert the feather files so that they can be read in a more conventional way or create a
nautilus_trader.persistence.read_feather
convenience function.The text was updated successfully, but these errors were encountered: