|
import bt
from bt_algos_extend import SelectTopK
order_by = 'alpha003'#'double_low'#'double_low'
signal = CSVDataloader.get_col_df(df,col=order_by)
#signal.dropna(inplace=True)
all = []
for K in [30,]:
s = bt.Strategy('可转债单因子策略'.format(K), [
bt.algos.RunWeekly(),
SelectTopK(signal,K,sort_descending=False),
bt.algos.WeighEqually(),
bt.algos.Rebalance()])
all.append(s)
stras = [bt.Backtest(s, data) for s in all]
这个bt是backtrader吗,但是我换成backtrader也不行,找不到下面的bt的属性
|
|