kernc / backtesting.py

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.
https://kernc.github.io/backtesting.py/
GNU Affero General Public License v3.0
5.06k stars 990 forks source link

ValueError: the lower bound 3 has to be less than the upper bound 3 #1014

Closed efeint01 closed 1 year ago

efeint01 commented 1 year ago

When i try to use method="skopt" gotta this error:

Traceback (most recent call last):
  File "C:\Users\user\Desktop\newbacktest\Basic Backtest\main.py", line 36, in <module>
    stats, settings, results, bt = strategies.start(data, symbol, interval, start_date, end_date)
  File "C:\Users\user\Desktop\newbacktest\Basic Backtest\strategies.py", line 306, in start
    stats = bt.optimize(
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\backtesting\backtesting.py", line 1490, in optimize
    output = _optimize_skopt()
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\backtesting\backtesting.py", line 1424, in _optimize_skopt
    dimensions.append(Integer(low=values.min(), high=values.max(), name=key))
  File "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\skopt\space\space.py", line 440, in __init__
    raise ValueError("the lower bound {} has to be less than the"