Passing Default Data In Optimizer #562
Unanswered
DanielGelfand
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
Beta Was this translation helpful? Give feedback.
All reactions