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

Passing Default Data In Optimizer #562

Unanswered
DanielGelfand asked this question in Q&A
Discussion options

How can I pass default variables to my Strategy when running with bt.optimize()?

I currently have a strategy variable signals_per_date which takes a dictionary such as {20211201: {ABC Stock: BUY, DEF Stock: Sell, etc.}}, plug that into an indicator in my strategy which aggregates the individual signals into one signal for the ticker im running on to use. Initially I have it set to an empty dictionary but set it when creating stats object.

The problem is I can't pass a default value for signals_per_date when running bt.optimize() but I can with bt.run(signals_per_date=my_dict_of_signals). I can't pre-aggregate the signals into a single signal and attach to my OHLC data I am running the sim on because I need to optimize the aggregation strategy. Is there a way to maybe pass default variable values to the init method of the strategy?

Any help would be appreciated. Thanks

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

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