vectorbt icon indicating copy to clipboard operation
vectorbt copied to clipboard

TypeError: IndicatorFactory.from_apply_func() missing 1 required positional argument: 'self'

Open lylkr opened this issue 8 months ago • 1 comments

vectorbt 0.27.3, python3.13 or 3.11,pandas 2.2.3

turnover_series = pd1['turnover'] indicator_factory = vbt.IndicatorFactory.from_apply_func( lambda turnover_data: turnover_data.rolling(window=5).mean(), input_names=['turnover_data'] ) result = indicator_factory.run(turnover_data=turnover_series)

run or debug:TypeError: IndicatorFactory.from_apply_func() missing 1 required positional argument: 'apply_func'

turnover_series = pd1['turnover'] indicator_factory = vbt.IndicatorFactory.from_apply_func( apply_func=lambda turnover_data: turnover_data.rolling(window=5).mean(), input_names=['turnover_data'] ) result = indicator_factory.run(turnover_data=turnover_series)

run or debug:TypeError: IndicatorFactory.from_apply_func() missing 1 required positional argument: 'self'

lylkr avatar May 14 '25 18:05 lylkr

IndicatorFactory needs to be initialized first, see examples

polakowo avatar Jun 05 '25 15:06 polakowo