-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
I would like to propagate data from the strategy upstream to the Backtest's client code.
My use-case is the following: I have several strategies and multiple ML algorithms. I can collect in-sample and out-of-sample reports as a dataframe. I can then merge the ML reports with the Backtest stats to create a single row consolidated report with not only performance analytics but also ML report. I would run the Backtest against the cross product of the ML algorithms and trading strategies and review a final output in Excel containing all the data. Actually it is a bit more detailed than that, as I have ML report data for the Bull models and for the Bear models.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 1 reply
-
I could use contextvars for this purpose, feels a bit odd but I can live with that :)
https://docs.python.org/3/library/contextvars.html
Beta Was this translation helpful? Give feedback.
All reactions
-
Does #39 provide what you're looking for?
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks a lot @kernc! yes I ended doing that, modifying by side effect the data I pass to the strategy.
Beta Was this translation helpful? Give feedback.