Closed jrycw closed 3 years ago
Thank you for the contribution. But, I don't think if variables
literally covers all the scenarios. Here is an example:
@Strategy(n1=1, n2=2)
def strategy(ohlcv):
...
return entries, exits
With the strategy above, if we perform backtesting
strategy.backtest(ohlcv, {'n1': 11, 'n2': 3})
then the variables of the strategy become:
strategy.n1 # 11
strategy.n2 # 3
If we perform backtesting again as follows
strategy.backtest(ohlcv, {'n2': 2})
, the variable n1
is set to 11
, not 1
, which could confuse users.
Thank you and look forward to other improvements.
Understood. This is a use case that I did not consider.
It seems that
if self._default_parameters
scenario can be covered byif variables
scenario.