Skip to content

Python Noob question about Strategy Classes, Inheritance and class variables #202

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

You must be logged in to vote

create a different run of Backtest

Backtest.run() takes variable assignments as keyword arguments.

stats = bt.run(n1=1, n2=10)
# or
params = {'n1': 1, 'n2': 10}
stats = bt.run(**params)

Is this what you were looking for?


Re:

smacross_fast = SmaCross #create an instance of the original class

This does not actually create anything. smacross_fast is the same SmaCross class.

>>> smacross_fast is SmaCross
True

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@eervin123
Comment options

eervin123 Dec 18, 2020
Author Sponsor

@SW4T400
Comment options

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