How to change the optimization input parameter range to include decimal values instead of just integers? #934
-
bt = Backtest(BackTestingData, SuperTrendPlus, cash=starting_cash, stats, heatmap = bt.optimize(ATR_Period=range( How to change the optimization input parameter range to include decimal values instead of just integers?like InputMultuplier=range(4, 6, 0.5) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The optimizer takes a Therefore you can do something like this:
You can also just type out the list: Or use The optimizer may take an |
Beta Was this translation helpful? Give feedback.
The optimizer takes a
list
or similar type as arguments for the parameters to optimize over.Therefore you can do something like this:
You can also just type out the list:
InputMultiplier=[4, 4.5, 5, 5.5, 6]
Or use
numpy,arange
which is similar torange
(remember that we need to convert to list):InputMultiplier=list(np.arange(4, 6, 0.5))
The optimizer may take an
np.array
type, but I'm not sure.