Skip to content

How to dynamically inject logic in a strategy at runtime? #292

Answered by kernc
binarymason asked this question in Q&A
Discussion options

You must be logged in to vote
MyBacktest = type('MyBacktest', (Strategy,), dict(
  sig.params, init=sig.setup, next=sig.next
))

You're not calling super() methods in your overriding "init" and next. Strategy methods never fire.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@binarymason
Comment options

Answer selected by binarymason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants