Open avrenli2 opened 7 months ago
"smac" strategy's optimization tool is not working.
import fastquant df = fastquant.get_stock_data("TSLA", "2018-01-01", "2024-01-01") opt = fastquant.backtest("smac", df, fast_period=range(2,20), slow_period=range(2,30))
ValueError Traceback (most recent call last) in <cell line: 1>() ----> 1 opt = ft.backtest("smac", df, fast_period=range(2,20), slow_period=range(2,30))
/usr/local/lib/python3.10/dist-packages/fastquant/backtest/backtest.py in backtest(strategy, data, commission, init_cash, plot, fractional, slippage, single_position, verbose, sort_by, sentiments, strats, return_history, return_plot, channel, symbol, allow_short, short_max, figsize, multi_line_indicators, data_class, data_kwargs, plotkwargs, fig, **kwargs) 243 print("=============================================") 244 print("Plotting backtest for optimal parameters ...") --> 245 , fig = backtest( 246 strategy, 247 data,
ValueError: too many values to unpack (expected 2)
Problem description
"smac" strategy's optimization tool is not working.
Example
Expected behavior
ValueError Traceback (most recent call last) in <cell line: 1>()
----> 1 opt = ft.backtest("smac", df, fast_period=range(2,20), slow_period=range(2,30))
/usr/local/lib/python3.10/dist-packages/fastquant/backtest/backtest.py in backtest(strategy, data, commission, init_cash, plot, fractional, slippage, single_position, verbose, sort_by, sentiments, strats, return_history, return_plot, channel, symbol, allow_short, short_max, figsize, multi_line_indicators, data_class, data_kwargs, plotkwargs, fig, **kwargs) 243 print("=============================================") 244 print("Plotting backtest for optimal parameters ...") --> 245 , fig = backtest( 246 strategy, 247 data,
ValueError: too many values to unpack (expected 2)
Environment