Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How can I pass data from the strategy upstream to the final output? #1292

bravegag started this conversation in General
Discussion options

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.

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

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

You must be logged in to vote
0 replies
Comment options

Does #39 provide what you're looking for?

You must be logged in to vote
1 reply
Comment options

Thanks a lot @kernc! yes I ended doing that, modifying by side effect the data I pass to the strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /