Skip to content

Commit cc7df06

Browse files
committed
🐛: Handle constant params
1 parent 1e09c8b commit cc7df06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtesting/backtesting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ def _optimize_openbox() -> Union[pd.Series,
15631563
values = values.astype(int)
15641564

15651565
if len(values) == 1:
1566-
variables.append(sp.Constant(value=values.astype("f")[0], name=key))
1566+
variables.append(sp.Constant(value=float(values[0]), name=key))
15671567
elif values.dtype.kind in 'iumM':
15681568
variables.append(sp.Int(lower=values.min(), upper=values.max(), name=key))
15691569
elif values.dtype.kind == 'f':

0 commit comments

Comments
 (0)