optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) median 夏普= 98特征 optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) median 特征变成105,夏普=0.29 optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.37 optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) 0 特征变成105,夏普=0.27 optimizers.Adam(lr=0.00025, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.28 optimizers.Adam(lr=0.00015, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.38,kerel—size=6,drop=0.1,batch=1024 optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.25,kerel—size=6 optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.21,kerel—size=6 optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.4,kerel—size=6,drop=0.2,batch=256 optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.37,kerel—size=2-5,drop=0.2,batch=256 optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.44/0.34,kerel—size=2-4,drop=0.2,batch=256,中证800,去除ST退市 optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.56,kerel—size=2-4,drop=0.2,batch=256,中证800,非退市含ST,去极3 optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.57,kerel—size=2-4,drop=0.2,batch=128,中证800,非退市含ST,去极3 optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.47,kerel—size=2-4,drop=0.2,batch=256,中证800,非退市含ST,去极3 optimizers.Adam(lr=0.0003, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.41,kerel—size=2-4,drop=0.2,batch=256,中证800,非退市含ST,去极3 optimizers.Adam(lr=0.00025, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False) mean 特征变成105,夏普=0.32,kerel—size=2-4,drop=0.2,batch=256,中证800,非退市含ST,去极3
import tensorflow as tf
# gpus = tf.config.list_physical_devices("GPU")
# tf.config.experimental.set_memory_growth(gpus[0], True)
from tensorflow.keras import optimizers
# 本代码由可视化策略环境自动生成 2021年12月29日 21:13
# 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端
def m4_run_bigquant_run(input_1, input_2, input_3):
# 示例代码如下。在这里编写您的代码
df = input_1.read()
df["x"]=df["x"].transpose(0,2,1)
from sklearn.model_selection import train_test_split
#data = input_1.read()
data=df
x_train, x_val, y_train, y_val = train_test_split(data["x"], data['y'], shuffle=False, test_size=0.2)
data_1 = DataSource.write_pickle({'x': x_train, 'y': y_train})
data_2 = DataSource.write_pickle({'x': x_val, 'y': y_val})
return Outputs(data_1=data_1, data_2=data_2, data_3=None)
# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。
def m4_post_run_bigquant_run(outputs):
return outputs
def m28_run_bigquant_run(input_1, input_2, input_3):
# 示例代码如下。在这里编写您的代码
df = input_1.read_pickle()
feature_len = len(input_2.read_pickle())
#df['x'] = df['x'].reshape(df['x'].shape[0], int(feature_len), 5)
df['x'] = df['x'].transpose(0,2,1)
data_1 = DataSource.write_pickle(df)
return Outputs(data_1=data_1)# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端
# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。
def m28_post_run_bigquant_run(outputs):
return outputs
from tensorflow.keras.callbacks import EarlyStopping
m35_earlystop_bigquant_run=EarlyStopping(monitor='val_mse', min_delta=0.0001, patience=5)
# 用户的自定义层需要写到字典中,比如
# {
# "MyLayer": MyLayer
# }
m35_custom_objects_bigquant_run = {
}
# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端
def m24_run_bigquant_run(input_1, input_2, input_3):
# 示例代码如下。在这里编写您的代码
pred_label = input_1.read_pickle()
df = input_2.read_df()
df = pd.DataFrame({'pred_label':pred_label[:,0], 'instrument':df.instrument, 'date':df.date})
df.sort_values(['date','pred_label'],inplace=True, ascending=[True,False])
return Outputs(data_1=DataSource.write_df(df), data_2=None, data_3=None)
# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。
def m24_post_run_bigquant_run(outputs):
return outputs
# 回测引擎:初始化函数,只执行一次
def m19_initialize_bigquant_run(context):
# 加载预测数据
context.ranker_prediction = context.options['data'].read_df()
# 系统已经设置了默认的交易手续费和滑点,要修改手续费可使用如下函数
context.set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0003, min_cost=5))
# 预测数据,通过options传入进来,使用 read_df 函数,加载到内存 (DataFrame)
# 设置买入的股票数量,这里买入预测股票列表排名靠前的5只
stock_count = 20
# 每只的股票的权重,如下的权重分配会使得靠前的股票分配多一点的资金,[0.339160, 0.213986, 0.169580, ..]
#context.stock_weights = T.norm([1 / math.log(i + 2) for i in range(0, stock_count)])
context.stock_weights = [0.95/stock_count for i in range(0, stock_count)]
# 设置每只股票占用的最大资金比例
context.max_cash_per_instrument = 0.05
context.options['hold_days'] = 5
# 回测引擎:每日数据处理函数,每天执行一次
def m19_handle_data_bigquant_run(context, data):
# 按日期过滤得到今日的预测数据
ranker_prediction = context.ranker_prediction[
context.ranker_prediction.date == data.current_dt.strftime('%Y-%m-%d')]
# 1. 资金分配
# 平均持仓时间是hold_days,每日都将买入股票,每日预期使用 1/hold_days 的资金
# 实际操作中,会存在一定的买入误差,所以在前hold_days天,等量使用资金;之后,尽量使用剩余资金(这里设置最多用等量的1.5倍)
is_staging = context.trading_day_index < context.options['hold_days'] # 是否在建仓期间(前 hold_days 天)
cash_avg = context.portfolio.portfolio_value / context.options['hold_days']
cash_for_buy = min(context.portfolio.cash, (1 if is_staging else 1.5) * cash_avg)
cash_for_sell = cash_avg - (context.portfolio.cash - cash_for_buy)
positions = {e.symbol: p.amount * p.last_sale_price
for e, p in context.perf_tracker.position_tracker.positions.items()}
# 2. 生成卖出订单:hold_days天之后才开始卖出;对持仓的股票,按机器学习算法预测的排序末位淘汰
if not is_staging and cash_for_sell > 0:
equities = {e.symbol: e for e, p in context.perf_tracker.position_tracker.positions.items()}
instruments = list(reversed(list(ranker_prediction.instrument[ranker_prediction.instrument.apply(
lambda x: x in equities and not context.has_unfinished_sell_order(equities[x]))])))
# print('rank order for sell %s' % instruments)
for instrument in instruments:
context.order_target(context.symbol(instrument), 0)
cash_for_sell -= positions[instrument]
if cash_for_sell <= 0:
break
# 3. 生成买入订单:按机器学习算法预测的排序,买入前面的stock_count只股票
buy_cash_weights = context.stock_weights
buy_instruments = list(ranker_prediction.instrument[:len(buy_cash_weights)])
max_cash_per_instrument = context.portfolio.portfolio_value * context.max_cash_per_instrument
for i, instrument in enumerate(buy_instruments):
cash = cash_for_buy * buy_cash_weights[i]
if cash > max_cash_per_instrument - positions.get(instrument, 0):
# 确保股票持仓量不会超过每次股票最大的占用资金量
cash = max_cash_per_instrument - positions.get(instrument, 0)
if cash > 0:
context.order_value(context.symbol(instrument), cash)
# 回测引擎:准备数据,只执行一次
def m19_prepare_bigquant_run(context):
pass
g = T.Graph({
'm1': 'M.instruments.v2',
'm1.start_date': '2010-01-01',
'm1.end_date': '2017-12-31',
'm1.market': 'CN_STOCK_A',
'm1.instrument_list': '',
'm1.max_count': 0,
'm2': 'M.advanced_auto_labeler.v2',
'm2.instruments': T.Graph.OutputPort('m1.data'),
'm2.label_expr': """# #号开始的表示注释
# 0. 每行一个,顺序执行,从第二个开始,可以使用label字段
# 1. 可用数据字段见 https://bigquant.com/docs/data_history_data.html
# 添加benchmark_前缀,可使用对应的benchmark数据
# 2. 可用操作符和函数见 `表达式引擎 <https://bigquant.com/docs/big_expr.html>`_
# 计算收益:5日收盘价(作为卖出价格)除以明日开盘价(作为买入价格)
shift(close, -5) / shift(open, -1) - 1
# 极值处理:用1%和99%分位的值做clip
clip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))
# 过滤掉一字涨停的情况 (设置label为NaN,在后续处理和训练中会忽略NaN的label)
where(shift(high, -1) == shift(low, -1), NaN, label)
""",
'm2.start_date': '',
'm2.end_date': '',
'm2.benchmark': '000300.SHA',
'm2.drop_na_label': True,
'm2.cast_label_int': False,
'm13': 'M.standardlize.v8',
'm13.input_1': T.Graph.OutputPort('m2.data'),
'm13.columns_input': 'label',
'm3': 'M.input_features.v1',
'm3.features': """close_0
open_0
high_0
low_0
amount_0
turn_0
return_0
close_1
open_1
high_1
low_1
return_1
amount_1
turn_1
close_2
open_2
high_2
low_2
amount_2
turn_2
return_2
close_3
open_3
high_3
low_3
amount_3
turn_3
return_3
close_4
open_4
high_4
low_4
amount_4
turn_4
return_4
mean(close_0, 5)
mean(low_0, 5)
mean(open_0, 5)
mean(high_0, 5)
mean(turn_0, 5)
mean(amount_0, 5)
mean(return_0, 5)
ts_max(close_0, 5)
ts_max(low_0, 5)
ts_max(open_0, 5)
ts_max(high_0, 5)
ts_max(turn_0, 5)
ts_max(amount_0, 5)
ts_max(return_0, 5)
ts_min(close_0, 5)
ts_min(low_0, 5)
ts_min(open_0, 5)
ts_min(high_0, 5)
ts_min(turn_0, 5)
ts_min(amount_0, 5)
ts_min(return_0, 5)
std(close_0, 5)
std(low_0, 5)
std(open_0, 5)
std(high_0, 5)
std(turn_0, 5)
std(amount_0, 5)
std(return_0, 5)
ts_rank(close_0, 5)
ts_rank(low_0, 5)
ts_rank(open_0, 5)
ts_rank(high_0, 5)
ts_rank(turn_0, 5)
ts_rank(amount_0, 5)
ts_rank(return_0, 5)
decay_linear(close_0, 5)
decay_linear(low_0, 5)
decay_linear(open_0, 5)
decay_linear(high_0, 5)
decay_linear(turn_0, 5)
decay_linear(amount_0, 5)
decay_linear(return_0, 5)
correlation(volume_0, return_0, 5)
correlation(volume_0, high_0, 5)
correlation(volume_0, low_0, 5)
correlation(volume_0, close_0, 5)
correlation(volume_0, open_0, 5)
correlation(volume_0, turn_0, 5)
correlation(return_0, high_0, 5)
correlation(return_0, low_0, 5)
correlation(return_0, close_0, 5)
correlation(return_0, open_0, 5)
correlation(return_0, turn_0, 5)
correlation(high_0, low_0, 5)
correlation(high_0, close_0, 5)
correlation(high_0, open_0, 5)
correlation(high_0, turn_0, 5)
correlation(low_0, close_0, 5)
correlation(low_0, open_0, 5)
correlation(low_0, turn_0, 5)
correlation(close_0, open_0, 5)
correlation(close_0, turn_0, 5)
correlation(open_0, turn_0, 5)
delta(close_0, 5)
delta(low_0, 5)
delta(open_0, 5)
delta(high_0, 5)
delta(turn_0, 5)
delta(amount_0, 5)
delta(return_0, 5)""",
'm15': 'M.general_feature_extractor.v7',
'm15.instruments': T.Graph.OutputPort('m1.data'),
'm15.features': T.Graph.OutputPort('m3.data'),
'm15.start_date': '',
'm15.end_date': '',
'm15.before_start_days': 10,
'm16': 'M.derived_feature_extractor.v3',
'm16.input_data': T.Graph.OutputPort('m15.data'),
'm16.features': T.Graph.OutputPort('m3.data'),
'm16.date_col': 'date',
'm16.instrument_col': 'instrument',
'm16.drop_na': True,
'm16.remove_extra_columns': False,
'm5': 'M.chinaa_stock_filter.v1',
'm5.input_data': T.Graph.OutputPort('m16.data'),
'm5.index_constituent_cond': ['中证500'],
'm5.board_cond': ['全部'],
'm5.industry_cond': ['全部'],
'm5.st_cond': ['全部'],
'm5.delist_cond': ['非退市'],
'm5.output_left_data': False,
'm14': 'M.standardlize.v8',
'm14.input_1': T.Graph.OutputPort('m5.data'),
'm14.input_2': T.Graph.OutputPort('m3.data'),
'm14.columns_input': '',
'm10': 'M.winsorize.v6',
'm10.input_data': T.Graph.OutputPort('m14.data'),
'm10.features': T.Graph.OutputPort('m3.data'),
'm10.columns_input': '',
'm10.median_deviate': 3,
'm21': 'M.fillnan.v1',
'm21.input_data': T.Graph.OutputPort('m10.data'),
'm21.features': T.Graph.OutputPort('m3.data'),
'm21.fill_value': 'mean',
'm7': 'M.join.v3',
'm7.data1': T.Graph.OutputPort('m13.data'),
'm7.data2': T.Graph.OutputPort('m21.data'),
'm7.on': 'date,instrument',
'm7.how': 'inner',
'm7.sort': False,
'm26': 'M.dl_convert_to_bin.v2',
'm26.input_data': T.Graph.OutputPort('m7.data'),
'm26.features': T.Graph.OutputPort('m3.data'),
'm26.window_size': 5,
'm26.feature_clip': 5,
'm26.flatten': False,
'm26.window_along_col': 'instrument',
'm4': 'M.cached.v3',
'm4.input_1': T.Graph.OutputPort('m26.data'),
'm4.input_2': T.Graph.OutputPort('m3.data'),
'm4.run': m4_run_bigquant_run,
'm4.post_run': m4_post_run_bigquant_run,
'm4.input_ports': '',
'm4.params': '{}',
'm4.output_ports': '',
'm9': 'M.instruments.v2',
'm9.start_date': T.live_run_param('trading_date', '2018-01-01'),
'm9.end_date': T.live_run_param('trading_date', '2021-09-30'),
'm9.market': 'CN_STOCK_A',
'm9.instrument_list': '',
'm9.max_count': 0,
'm17': 'M.general_feature_extractor.v7',
'm17.instruments': T.Graph.OutputPort('m9.data'),
'm17.features': T.Graph.OutputPort('m3.data'),
'm17.start_date': '',
'm17.end_date': '',
'm17.before_start_days': 10,
'm18': 'M.derived_feature_extractor.v3',
'm18.input_data': T.Graph.OutputPort('m17.data'),
'm18.features': T.Graph.OutputPort('m3.data'),
'm18.date_col': 'date',
'm18.instrument_col': 'instrument',
'm18.drop_na': True,
'm18.remove_extra_columns': False,
'm8': 'M.chinaa_stock_filter.v1',
'm8.input_data': T.Graph.OutputPort('m18.data'),
'm8.index_constituent_cond': ['中证500'],
'm8.board_cond': ['全部'],
'm8.industry_cond': ['全部'],
'm8.st_cond': ['全部'],
'm8.delist_cond': ['非退市'],
'm8.output_left_data': False,
'm25': 'M.standardlize.v8',
'm25.input_1': T.Graph.OutputPort('m8.data'),
'm25.input_2': T.Graph.OutputPort('m3.data'),
'm25.columns_input': '',
'm20': 'M.winsorize.v6',
'm20.input_data': T.Graph.OutputPort('m25.data'),
'm20.features': T.Graph.OutputPort('m3.data'),
'm20.columns_input': '',
'm20.median_deviate': 3,
'm22': 'M.fillnan.v1',
'm22.input_data': T.Graph.OutputPort('m20.data'),
'm22.features': T.Graph.OutputPort('m3.data'),
'm22.fill_value': 'mean',
'm27': 'M.dl_convert_to_bin.v2',
'm27.input_data': T.Graph.OutputPort('m22.data'),
'm27.features': T.Graph.OutputPort('m3.data'),
'm27.window_size': 5,
'm27.feature_clip': 5,
'm27.flatten': False,
'm27.window_along_col': 'instrument',
'm28': 'M.cached.v3',
'm28.input_1': T.Graph.OutputPort('m27.data'),
'm28.input_2': T.Graph.OutputPort('m3.data'),
'm28.run': m28_run_bigquant_run,
'm28.post_run': m28_post_run_bigquant_run,
'm28.input_ports': '',
'm28.params': '{}',
'm28.output_ports': '',
'm6': 'M.dl_layer_input.v1',
'm6.shape': '105,5',
'm6.batch_shape': '',
'm6.dtype': 'float32',
'm6.sparse': False,
'm6.name': '',
'm37': 'M.dl_layer_batchnormalization.v1',
'm37.inputs': T.Graph.OutputPort('m6.data'),
'm37.axis': -1,
'm37.momentum': 0.99,
'm37.epsilon': 0.001,
'm37.center': True,
'm37.scale': True,
'm37.beta_initializer': 'Zeros',
'm37.gamma_initializer': 'Ones',
'm37.moving_mean_initializer': 'Zeros',
'm37.moving_variance_initializer': 'Ones',
'm37.beta_regularizer': 'None',
'm37.beta_regularizer_l1': 0,
'm37.beta_regularizer_l2': 0,
'm37.gamma_regularizer': 'None',
'm37.gamma_regularizer_l1': 0,
'm37.gamma_regularizer_l2': 0,
'm37.beta_constraint': 'None',
'm37.gamma_constraint': 'None',
'm37.name': '',
'm43': 'M.dl_layer_conv1d.v1',
'm43.inputs': T.Graph.OutputPort('m37.data'),
'm43.filters': 128,
'm43.kernel_size': '3',
'm43.strides': '1',
'm43.padding': 'same',
'm43.dilation_rate': 1,
'm43.activation': 'relu',
'm43.use_bias': True,
'm43.kernel_initializer': 'glorot_uniform',
'm43.bias_initializer': 'Zeros',
'm43.kernel_regularizer': 'None',
'm43.kernel_regularizer_l1': 0,
'm43.kernel_regularizer_l2': 0,
'm43.bias_regularizer': 'None',
'm43.bias_regularizer_l1': 0,
'm43.bias_regularizer_l2': 0,
'm43.activity_regularizer': 'None',
'm43.activity_regularizer_l1': 0,
'm43.activity_regularizer_l2': 0,
'm43.kernel_constraint': 'None',
'm43.bias_constraint': 'None',
'm43.name': '',
'm44': 'M.dl_layer_conv1d.v1',
'm44.inputs': T.Graph.OutputPort('m43.data'),
'm44.filters': 128,
'm44.kernel_size': '3',
'm44.strides': '1',
'm44.padding': 'same',
'm44.dilation_rate': 1,
'm44.activation': 'relu',
'm44.use_bias': True,
'm44.kernel_initializer': 'glorot_uniform',
'm44.bias_initializer': 'Zeros',
'm44.kernel_regularizer': 'None',
'm44.kernel_regularizer_l1': 0,
'm44.kernel_regularizer_l2': 0,
'm44.bias_regularizer': 'None',
'm44.bias_regularizer_l1': 0,
'm44.bias_regularizer_l2': 0,
'm44.activity_regularizer': 'None',
'm44.activity_regularizer_l1': 0,
'm44.activity_regularizer_l2': 0,
'm44.kernel_constraint': 'None',
'm44.bias_constraint': 'None',
'm44.name': '',
'm41': 'M.dl_layer_maxpooling1d.v1',
'm41.inputs': T.Graph.OutputPort('m44.data'),
'm41.pool_size': 2,
'm41.padding': 'valid',
'm41.name': '',
'm45': 'M.dl_layer_conv1d.v1',
'm45.inputs': T.Graph.OutputPort('m41.data'),
'm45.filters': 128,
'm45.kernel_size': '5',
'm45.strides': '1',
'm45.padding': 'same',
'm45.dilation_rate': 1,
'm45.activation': 'relu',
'm45.use_bias': True,
'm45.kernel_initializer': 'glorot_uniform',
'm45.bias_initializer': 'Zeros',
'm45.kernel_regularizer': 'None',
'm45.kernel_regularizer_l1': 0,
'm45.kernel_regularizer_l2': 0,
'm45.bias_regularizer': 'None',
'm45.bias_regularizer_l1': 0,
'm45.bias_regularizer_l2': 0,
'm45.activity_regularizer': 'None',
'm45.activity_regularizer_l1': 0,
'm45.activity_regularizer_l2': 0,
'm45.kernel_constraint': 'None',
'm45.bias_constraint': 'None',
'm45.name': '',
'm47': 'M.dl_layer_conv1d.v1',
'm47.inputs': T.Graph.OutputPort('m45.data'),
'm47.filters': 128,
'm47.kernel_size': '5',
'm47.strides': '1',
'm47.padding': 'same',
'm47.dilation_rate': 1,
'm47.activation': 'relu',
'm47.use_bias': True,
'm47.kernel_initializer': 'glorot_uniform',
'm47.bias_initializer': 'Zeros',
'm47.kernel_regularizer': 'None',
'm47.kernel_regularizer_l1': 0,
'm47.kernel_regularizer_l2': 0,
'm47.bias_regularizer': 'None',
'm47.bias_regularizer_l1': 0,
'm47.bias_regularizer_l2': 0,
'm47.activity_regularizer': 'None',
'm47.activity_regularizer_l1': 0,
'm47.activity_regularizer_l2': 0,
'm47.kernel_constraint': 'None',
'm47.bias_constraint': 'None',
'm47.name': '',
'm48': 'M.dl_layer_batchnormalization.v1',
'm48.inputs': T.Graph.OutputPort('m47.data'),
'm48.axis': -1,
'm48.momentum': 0.99,
'm48.epsilon': 0.001,
'm48.center': True,
'm48.scale': True,
'm48.beta_initializer': 'Zeros',
'm48.gamma_initializer': 'Ones',
'm48.moving_mean_initializer': 'Zeros',
'm48.moving_variance_initializer': 'Ones',
'm48.beta_regularizer': 'None',
'm48.beta_regularizer_l1': 0,
'm48.beta_regularizer_l2': 0,
'm48.gamma_regularizer': 'None',
'm48.gamma_regularizer_l1': 0,
'm48.gamma_regularizer_l2': 0,
'm48.beta_constraint': 'None',
'm48.gamma_constraint': 'None',
'm48.name': '',
'm50': 'M.dl_layer_conv1d.v1',
'm50.inputs': T.Graph.OutputPort('m48.data'),
'm50.filters': 128,
'm50.kernel_size': '3',
'm50.strides': '1',
'm50.padding': 'same',
'm50.dilation_rate': 1,
'm50.activation': 'relu',
'm50.use_bias': True,
'm50.kernel_initializer': 'glorot_uniform',
'm50.bias_initializer': 'Zeros',
'm50.kernel_regularizer': 'None',
'm50.kernel_regularizer_l1': 0,
'm50.kernel_regularizer_l2': 0,
'm50.bias_regularizer': 'None',
'm50.bias_regularizer_l1': 0,
'm50.bias_regularizer_l2': 0,
'm50.activity_regularizer': 'None',
'm50.activity_regularizer_l1': 0,
'm50.activity_regularizer_l2': 0,
'm50.kernel_constraint': 'None',
'm50.bias_constraint': 'None',
'm50.name': '',
'm51': 'M.dl_layer_batchnormalization.v1',
'm51.inputs': T.Graph.OutputPort('m50.data'),
'm51.axis': -1,
'm51.momentum': 0.99,
'm51.epsilon': 0.001,
'm51.center': True,
'm51.scale': True,
'm51.beta_initializer': 'Zeros',
'm51.gamma_initializer': 'Ones',
'm51.moving_mean_initializer': 'Zeros',
'm51.moving_variance_initializer': 'Ones',
'm51.beta_regularizer': 'None',
'm51.beta_regularizer_l1': 0,
'm51.beta_regularizer_l2': 0,
'm51.gamma_regularizer': 'None',
'm51.gamma_regularizer_l1': 0,
'm51.gamma_regularizer_l2': 0,
'm51.beta_constraint': 'None',
'm51.gamma_constraint': 'None',
'm51.name': '',
'm53': 'M.dl_layer_conv1d.v1',
'm53.inputs': T.Graph.OutputPort('m51.data'),
'm53.filters': 128,
'm53.kernel_size': '5',
'm53.strides': '1',
'm53.padding': 'same',
'm53.dilation_rate': 1,
'm53.activation': 'relu',
'm53.use_bias': True,
'm53.kernel_initializer': 'glorot_uniform',
'm53.bias_initializer': 'Zeros',
'm53.kernel_regularizer': 'None',
'm53.kernel_regularizer_l1': 0,
'm53.kernel_regularizer_l2': 0,
'm53.bias_regularizer': 'None',
'm53.bias_regularizer_l1': 0,
'm53.bias_regularizer_l2': 0,
'm53.activity_regularizer': 'None',
'm53.activity_regularizer_l1': 0,
'm53.activity_regularizer_l2': 0,
'm53.kernel_constraint': 'None',
'm53.bias_constraint': 'None',
'm53.name': '',
'm46': 'M.dl_layer_batchnormalization.v1',
'm46.inputs': T.Graph.OutputPort('m53.data'),
'm46.axis': -1,
'm46.momentum': 0.99,
'm46.epsilon': 0.001,
'm46.center': True,
'm46.scale': True,
'm46.beta_initializer': 'Zeros',
'm46.gamma_initializer': 'Ones',
'm46.moving_mean_initializer': 'Zeros',
'm46.moving_variance_initializer': 'Ones',
'm46.beta_regularizer': 'None',
'm46.beta_regularizer_l1': 0,
'm46.beta_regularizer_l2': 0,
'm46.gamma_regularizer': 'None',
'm46.gamma_regularizer_l1': 0,
'm46.gamma_regularizer_l2': 0,
'm46.beta_constraint': 'None',
'm46.gamma_constraint': 'None',
'm46.name': '',
'm49': 'M.dl_layer_conv1d.v1',
'm49.inputs': T.Graph.OutputPort('m46.data'),
'm49.filters': 128,
'm49.kernel_size': '5',
'm49.strides': '1',
'm49.padding': 'same',
'm49.dilation_rate': 1,
'm49.activation': 'relu',
'm49.use_bias': True,
'm49.kernel_initializer': 'glorot_uniform',
'm49.bias_initializer': 'Zeros',
'm49.kernel_regularizer': 'None',
'm49.kernel_regularizer_l1': 0,
'm49.kernel_regularizer_l2': 0,
'm49.bias_regularizer': 'None',
'm49.bias_regularizer_l1': 0,
'm49.bias_regularizer_l2': 0,
'm49.activity_regularizer': 'None',
'm49.activity_regularizer_l1': 0,
'm49.activity_regularizer_l2': 0,
'm49.kernel_constraint': 'None',
'm49.bias_constraint': 'None',
'm49.name': '',
'm62': 'M.dl_layer_add.v1',
'm62.input1': T.Graph.OutputPort('m49.data'),
'm62.input2': T.Graph.OutputPort('m47.data'),
'm62.name': '',
'm38': 'M.dl_layer_globalmaxpooling1d.v1',
'm38.inputs': T.Graph.OutputPort('m62.data'),
'm38.name': '',
'm61': 'M.dl_layer_dropout.v1',
'm61.inputs': T.Graph.OutputPort('m38.data'),
'm61.rate': 0.1,
'm61.noise_shape': '',
'm61.name': '',
'm57': 'M.dl_layer_dense.v1',
'm57.inputs': T.Graph.OutputPort('m61.data'),
'm57.units': 1,
'm57.activation': 'linear',
'm57.use_bias': True,
'm57.kernel_initializer': 'glorot_uniform',
'm57.bias_initializer': 'Zeros',
'm57.kernel_regularizer': 'None',
'm57.kernel_regularizer_l1': 0,
'm57.kernel_regularizer_l2': 0,
'm57.bias_regularizer': 'None',
'm57.bias_regularizer_l1': 0,
'm57.bias_regularizer_l2': 0,
'm57.activity_regularizer': 'None',
'm57.activity_regularizer_l1': 0,
'm57.activity_regularizer_l2': 0,
'm57.kernel_constraint': 'None',
'm57.bias_constraint': 'None',
'm57.name': '',
'm34': 'M.dl_model_init.v1',
'm34.inputs': T.Graph.OutputPort('m6.data'),
'm34.outputs': T.Graph.OutputPort('m57.data'),
'm35': 'M.dl_model_train.v1',
'm35.input_model': T.Graph.OutputPort('m34.data'),
'm35.training_data': T.Graph.OutputPort('m4.data_1'),
'm35.validation_data': T.Graph.OutputPort('m4.data_2'),
'm35.optimizer': '自定义',
'm35.user_optimizer': optimizers.Adam(lr=0.0002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.00, amsgrad=False),
'm35.loss': 'mean_squared_error',
'm35.metrics': 'mse',
'm35.batch_size': 512,
'm35.epochs': 10000,
'm35.earlystop': m35_earlystop_bigquant_run,
'm35.custom_objects': m35_custom_objects_bigquant_run,
'm35.n_gpus': 1,
'm35.verbose': '2:每个epoch输出一行记录',
'm35.m_cached': False,
'm11': 'M.dl_model_predict.v1',
'm11.trained_model': T.Graph.OutputPort('m35.data'),
'm11.input_data': T.Graph.OutputPort('m28.data_1'),
'm11.batch_size': 1024,
'm11.n_gpus': 1,
'm11.verbose': '2:每个epoch输出一行记录',
'm24': 'M.cached.v3',
'm24.input_1': T.Graph.OutputPort('m11.data'),
'm24.input_2': T.Graph.OutputPort('m22.data'),
'm24.run': m24_run_bigquant_run,
'm24.post_run': m24_post_run_bigquant_run,
'm24.input_ports': '',
'm24.params': '{}',
'm24.output_ports': '',
'm19': 'M.trade.v4',
'm19.instruments': T.Graph.OutputPort('m9.data'),
'm19.options_data': T.Graph.OutputPort('m24.data_1'),
'm19.start_date': '',
'm19.end_date': '',
'm19.initialize': m19_initialize_bigquant_run,
'm19.handle_data': m19_handle_data_bigquant_run,
'm19.prepare': m19_prepare_bigquant_run,
'm19.volume_limit': 0.025,
'm19.order_price_field_buy': 'open',
'm19.order_price_field_sell': 'close',
'm19.capital_base': 1000000,
'm19.auto_cancel_non_tradable_orders': True,
'm19.data_frequency': 'daily',
'm19.price_type': '后复权',
'm19.product_type': '股票',
'm19.plot_charts': True,
'm19.backtest_only': False,
'm19.benchmark': '000905.SHA',
})
# g.run({})
def m12_param_grid_builder_bigquant_run():
param_grid = {}
# 在这里设置需要调优的参数备选
# param_grid['m3.features'] = ['close_1/close_0', 'close_2/close_0\nclose_3/close_0']
# param_grid['m6.number_of_trees'] = [5, 10, 20]
param_grid['m61.rate'] = [0.1]
param_grid['m35.batch_size'] = [256,512]
return param_grid
def m12_scoring_bigquant_run(result):
score = result.get('m19').read_raw_perf()['sharpe'].tail(1)[0]
return {'score': score}
m12 = M.hyper_parameter_search.v1(
param_grid_builder=m12_param_grid_builder_bigquant_run,
scoring=m12_scoring_bigquant_run,
search_algorithm='网格搜索',
search_iterations=10,
workers=1,
worker_distributed_run=False,
worker_silent=False,
run_now=True,
bq_graph=g
)
[2021-12-29 20:30:12.338837] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-29 20:30:12.349354] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.351290] INFO: moduleinvoker: instruments.v2 运行完成[0.012469s].
[2021-12-29 20:30:12.356076] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-12-29 20:30:12.369055] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.371231] INFO: moduleinvoker: input_features.v1 运行完成[0.015155s].
[2021-12-29 20:30:12.408900] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-29 20:30:12.418524] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.420324] INFO: moduleinvoker: instruments.v2 运行完成[0.011445s].
[2021-12-29 20:30:12.430376] INFO: moduleinvoker: dl_layer_input.v1 运行完成[0.001698s].
[2021-12-29 20:30:12.442830] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2021-12-29 20:30:12.455128] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.456783] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[0.013955s].
[2021-12-29 20:30:12.477786] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-29 20:30:12.488282] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.490122] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.012366s].
[2021-12-29 20:30:12.506101] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-29 20:30:12.515177] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.517954] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.011855s].
[2021-12-29 20:30:12.554325] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.027501s].
[2021-12-29 20:30:12.560918] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:30:12.570088] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.572454] INFO: moduleinvoker: standardlize.v8 运行完成[0.011539s].
[2021-12-29 20:30:12.580283] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-29 20:30:12.593877] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.596119] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.015825s].
[2021-12-29 20:30:12.605161] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-29 20:30:12.615949] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.618882] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.013722s].
[2021-12-29 20:30:12.655449] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.026922s].
[2021-12-29 20:30:12.666543] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-29 20:30:12.677073] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.679498] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.012988s].
[2021-12-29 20:30:12.689677] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-29 20:30:12.700670] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.702775] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.013098s].
[2021-12-29 20:30:12.734826] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.024254s].
[2021-12-29 20:30:12.740335] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:30:12.750811] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.753371] INFO: moduleinvoker: standardlize.v8 运行完成[0.013026s].
[2021-12-29 20:30:12.760320] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:30:12.769538] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.771441] INFO: moduleinvoker: standardlize.v8 运行完成[0.011127s].
[2021-12-29 20:30:12.791777] INFO: moduleinvoker: dl_layer_maxpooling1d.v1 运行完成[0.012041s].
[2021-12-29 20:30:12.798631] INFO: moduleinvoker: winsorize.v6 开始运行..
[2021-12-29 20:30:12.806638] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.809206] INFO: moduleinvoker: winsorize.v6 运行完成[0.010569s].
[2021-12-29 20:30:12.817196] INFO: moduleinvoker: winsorize.v6 开始运行..
[2021-12-29 20:30:12.825783] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.828584] INFO: moduleinvoker: winsorize.v6 运行完成[0.011387s].
[2021-12-29 20:30:12.855313] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.019343s].
[2021-12-29 20:30:12.866571] INFO: moduleinvoker: fillnan.v1 开始运行..
[2021-12-29 20:30:12.876775] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.878666] INFO: moduleinvoker: fillnan.v1 运行完成[0.012097s].
[2021-12-29 20:30:12.892511] INFO: moduleinvoker: fillnan.v1 开始运行..
[2021-12-29 20:30:12.901608] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.903521] INFO: moduleinvoker: fillnan.v1 运行完成[0.011002s].
[2021-12-29 20:30:12.938374] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.024209s].
[2021-12-29 20:30:12.953050] INFO: moduleinvoker: join.v3 开始运行..
[2021-12-29 20:30:12.962360] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.964222] INFO: moduleinvoker: join.v3 运行完成[0.01119s].
[2021-12-29 20:30:12.981539] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-12-29 20:30:12.991130] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:12.992911] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.011404s].
[2021-12-29 20:30:13.032472] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.025244s].
[2021-12-29 20:30:13.052264] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-12-29 20:30:13.060048] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:13.061847] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.009599s].
[2021-12-29 20:30:13.084592] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:30:13.095564] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:13.097191] INFO: moduleinvoker: cached.v3 运行完成[0.012612s].
[2021-12-29 20:30:13.125472] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.022271s].
[2021-12-29 20:30:13.141109] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:30:13.151302] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:30:13.153157] INFO: moduleinvoker: cached.v3 运行完成[0.01207s].
[2021-12-29 20:30:13.182593] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.021824s].
[2021-12-29 20:30:13.209951] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.018681s].
[2021-12-29 20:30:13.245346] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.026944s].
[2021-12-29 20:30:13.305226] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.0167s].
[2021-12-29 20:30:13.320771] INFO: moduleinvoker: dl_layer_add.v1 运行完成[0.006987s].
[2021-12-29 20:30:13.339981] INFO: moduleinvoker: dl_layer_globalmaxpooling1d.v1 运行完成[0.006549s].
[2021-12-29 20:30:13.354765] INFO: moduleinvoker: dl_layer_dropout.v1 运行完成[0.005443s].
[2021-12-29 20:30:13.379936] INFO: moduleinvoker: dl_layer_dense.v1 运行完成[0.014594s].
[2021-12-29 20:30:13.458034] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:30:13.518564] INFO: moduleinvoker: cached.v3 运行完成[0.06053s].
[2021-12-29 20:30:13.521823] INFO: moduleinvoker: dl_model_init.v1 运行完成[0.133513s].
[2021-12-29 20:30:13.528118] INFO: moduleinvoker: dl_model_train.v1 开始运行..
[2021-12-29 20:30:16.813605] INFO: dl_model_train: 准备训练,训练样本个数:734484,迭代次数:10000
[2021-12-29 20:36:36.385803] INFO: dl_model_train: 训练结束,耗时:379.57s
[2021-12-29 20:36:36.435106] INFO: moduleinvoker: dl_model_train.v1 运行完成[382.906998s].
[2021-12-29 20:36:36.441267] INFO: moduleinvoker: dl_model_predict.v1 开始运行..
[2021-12-29 20:36:44.949354] INFO: moduleinvoker: dl_model_predict.v1 运行完成[8.5081s].
[2021-12-29 20:36:44.980491] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:36:47.892919] INFO: moduleinvoker: cached.v3 运行完成[2.912444s].
[2021-12-29 20:36:48.002010] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-12-29 20:36:48.008522] INFO: backtest: biglearning backtest:V8.6.1
[2021-12-29 20:36:48.010301] INFO: backtest: product_type:stock by specified
[2021-12-29 20:36:48.168677] INFO: moduleinvoker: cached.v2 开始运行..
[2021-12-29 20:36:48.181051] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:36:48.182821] INFO: moduleinvoker: cached.v2 运行完成[0.014163s].
[2021-12-29 20:36:52.596834] INFO: algo: TradingAlgorithm V1.8.6
[2021-12-29 20:36:54.464480] INFO: algo: trading transform...
[2021-12-29 20:37:58.180855] INFO: Performance: Simulated 912 trading days out of 912.
[2021-12-29 20:37:58.182447] INFO: Performance: first open: 2018-01-02 09:30:00+00:00
[2021-12-29 20:37:58.183577] INFO: Performance: last close: 2021-09-30 15:00:00+00:00
[2021-12-29 20:38:14.647520] INFO: moduleinvoker: backtest.v8 运行完成[86.645508s].
[2021-12-29 20:38:14.649450] INFO: moduleinvoker: trade.v4 运行完成[86.750075s].
[2021-12-29 20:38:15.558448] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-29 20:38:15.575384] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.577665] INFO: moduleinvoker: instruments.v2 运行完成[0.019222s].
[2021-12-29 20:38:15.582431] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-12-29 20:38:15.594827] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.596730] INFO: moduleinvoker: input_features.v1 运行完成[0.014303s].
[2021-12-29 20:38:15.603208] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-29 20:38:15.613011] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.615097] INFO: moduleinvoker: instruments.v2 运行完成[0.011878s].
[2021-12-29 20:38:15.625923] INFO: moduleinvoker: dl_layer_input.v1 运行完成[0.001816s].
[2021-12-29 20:38:15.641308] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2021-12-29 20:38:15.651260] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.654168] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[0.012859s].
[2021-12-29 20:38:15.678599] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-29 20:38:15.705504] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.707936] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.029325s].
[2021-12-29 20:38:15.734674] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-29 20:38:15.746147] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.748776] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.014112s].
[2021-12-29 20:38:15.777317] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.02056s].
[2021-12-29 20:38:15.783328] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:38:15.794557] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.796555] INFO: moduleinvoker: standardlize.v8 运行完成[0.013229s].
[2021-12-29 20:38:15.803656] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-29 20:38:15.818759] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.821265] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.017555s].
[2021-12-29 20:38:15.832126] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-29 20:38:15.844614] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.847086] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.014965s].
[2021-12-29 20:38:15.873148] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.018005s].
[2021-12-29 20:38:15.881737] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-29 20:38:15.893162] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.895395] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.013646s].
[2021-12-29 20:38:15.903677] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-29 20:38:15.914677] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.916864] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.01318s].
[2021-12-29 20:38:15.949092] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.023479s].
[2021-12-29 20:38:15.955290] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:38:15.966612] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.968607] INFO: moduleinvoker: standardlize.v8 运行完成[0.013313s].
[2021-12-29 20:38:15.974027] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:38:15.983945] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:15.985967] INFO: moduleinvoker: standardlize.v8 运行完成[0.011939s].
[2021-12-29 20:38:16.002157] INFO: moduleinvoker: dl_layer_maxpooling1d.v1 运行完成[0.009387s].
[2021-12-29 20:38:16.009061] INFO: moduleinvoker: winsorize.v6 开始运行..
[2021-12-29 20:38:16.023207] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.027417] INFO: moduleinvoker: winsorize.v6 运行完成[0.018376s].
[2021-12-29 20:38:16.035314] INFO: moduleinvoker: winsorize.v6 开始运行..
[2021-12-29 20:38:16.048485] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.050160] INFO: moduleinvoker: winsorize.v6 运行完成[0.01486s].
[2021-12-29 20:38:16.074362] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.016178s].
[2021-12-29 20:38:16.082415] INFO: moduleinvoker: fillnan.v1 开始运行..
[2021-12-29 20:38:16.093815] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.095417] INFO: moduleinvoker: fillnan.v1 运行完成[0.013006s].
[2021-12-29 20:38:16.103838] INFO: moduleinvoker: fillnan.v1 开始运行..
[2021-12-29 20:38:16.114591] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.117383] INFO: moduleinvoker: fillnan.v1 运行完成[0.013523s].
[2021-12-29 20:38:16.149786] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.023975s].
[2021-12-29 20:38:16.194233] INFO: moduleinvoker: join.v3 开始运行..
[2021-12-29 20:38:16.205500] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.207725] INFO: moduleinvoker: join.v3 运行完成[0.013485s].
[2021-12-29 20:38:16.227190] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-12-29 20:38:16.241323] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.244635] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.017482s].
[2021-12-29 20:38:16.275506] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.0233s].
[2021-12-29 20:38:16.294193] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-12-29 20:38:16.303891] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.305898] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.01173s].
[2021-12-29 20:38:16.322252] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:38:16.332143] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.334137] INFO: moduleinvoker: cached.v3 运行完成[0.011891s].
[2021-12-29 20:38:16.364702] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.023253s].
[2021-12-29 20:38:16.377816] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:38:16.393515] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:38:16.395990] INFO: moduleinvoker: cached.v3 运行完成[0.018183s].
[2021-12-29 20:38:16.431981] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.029011s].
[2021-12-29 20:38:16.469294] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.016605s].
[2021-12-29 20:38:16.493817] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.016659s].
[2021-12-29 20:38:16.520061] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.020252s].
[2021-12-29 20:38:16.536904] INFO: moduleinvoker: dl_layer_add.v1 运行完成[0.007223s].
[2021-12-29 20:38:16.551146] INFO: moduleinvoker: dl_layer_globalmaxpooling1d.v1 运行完成[0.006329s].
[2021-12-29 20:38:16.564423] INFO: moduleinvoker: dl_layer_dropout.v1 运行完成[0.005176s].
[2021-12-29 20:38:16.583455] INFO: moduleinvoker: dl_layer_dense.v1 运行完成[0.01301s].
[2021-12-29 20:38:16.679071] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:38:16.721182] INFO: moduleinvoker: cached.v3 运行完成[0.042123s].
[2021-12-29 20:38:16.724681] INFO: moduleinvoker: dl_model_init.v1 运行完成[0.135025s].
[2021-12-29 20:38:16.730069] INFO: moduleinvoker: dl_model_train.v1 开始运行..
[2021-12-29 20:38:19.707722] INFO: dl_model_train: 准备训练,训练样本个数:734484,迭代次数:10000
[2021-12-29 20:46:35.678153] INFO: dl_model_train: 训练结束,耗时:495.97s
[2021-12-29 20:46:35.738643] INFO: moduleinvoker: dl_model_train.v1 运行完成[499.00855s].
[2021-12-29 20:46:35.748094] INFO: moduleinvoker: dl_model_predict.v1 开始运行..
[2021-12-29 20:46:44.569735] INFO: moduleinvoker: dl_model_predict.v1 运行完成[8.821655s].
[2021-12-29 20:46:44.585287] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:46:48.000104] INFO: moduleinvoker: cached.v3 运行完成[3.414826s].
[2021-12-29 20:46:48.077595] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-12-29 20:46:48.083260] INFO: backtest: biglearning backtest:V8.6.1
[2021-12-29 20:46:48.084564] INFO: backtest: product_type:stock by specified
[2021-12-29 20:46:48.250990] INFO: moduleinvoker: cached.v2 开始运行..
[2021-12-29 20:46:48.273932] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:46:48.276101] INFO: moduleinvoker: cached.v2 运行完成[0.02515s].
[2021-12-29 20:46:53.283671] INFO: algo: TradingAlgorithm V1.8.6
[2021-12-29 20:46:55.383177] INFO: algo: trading transform...
[2021-12-29 20:48:00.898346] INFO: Performance: Simulated 912 trading days out of 912.
[2021-12-29 20:48:00.901803] INFO: Performance: first open: 2018-01-02 09:30:00+00:00
[2021-12-29 20:48:00.904721] INFO: Performance: last close: 2021-09-30 15:00:00+00:00
[2021-12-29 20:48:15.989732] INFO: moduleinvoker: backtest.v8 运行完成[87.912132s].
[2021-12-29 20:48:15.991504] INFO: moduleinvoker: trade.v4 运行完成[87.983372s].
[2021-12-29 20:48:17.618513] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-29 20:48:17.632060] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.634737] INFO: moduleinvoker: instruments.v2 运行完成[0.016208s].
[2021-12-29 20:48:17.640490] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-12-29 20:48:17.649092] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.651518] INFO: moduleinvoker: input_features.v1 运行完成[0.01103s].
[2021-12-29 20:48:17.658580] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-29 20:48:17.666808] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.668631] INFO: moduleinvoker: instruments.v2 运行完成[0.010044s].
[2021-12-29 20:48:17.677080] INFO: moduleinvoker: dl_layer_input.v1 运行完成[0.001413s].
[2021-12-29 20:48:17.686154] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2021-12-29 20:48:17.697694] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.699752] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[0.013602s].
[2021-12-29 20:48:17.721843] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-29 20:48:17.733824] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.735980] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.01416s].
[2021-12-29 20:48:17.753717] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-29 20:48:17.763691] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.765994] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.01227s].
[2021-12-29 20:48:17.799977] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.026753s].
[2021-12-29 20:48:17.806057] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:48:17.818898] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.821784] INFO: moduleinvoker: standardlize.v8 运行完成[0.015735s].
[2021-12-29 20:48:17.831500] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-29 20:48:17.840801] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.843613] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.012111s].
[2021-12-29 20:48:17.855700] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-29 20:48:17.864267] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.866104] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.010398s].
[2021-12-29 20:48:17.893446] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.02101s].
[2021-12-29 20:48:17.906979] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-29 20:48:17.922395] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.925398] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.018409s].
[2021-12-29 20:48:17.937214] INFO: moduleinvoker: chinaa_stock_filter.v1 开始运行..
[2021-12-29 20:48:17.951805] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:17.953886] INFO: moduleinvoker: chinaa_stock_filter.v1 运行完成[0.016671s].
[2021-12-29 20:48:17.984752] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.023453s].
[2021-12-29 20:48:17.990649] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:48:18.003308] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.005320] INFO: moduleinvoker: standardlize.v8 运行完成[0.014667s].
[2021-12-29 20:48:18.012833] INFO: moduleinvoker: standardlize.v8 开始运行..
[2021-12-29 20:48:18.031338] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.034211] INFO: moduleinvoker: standardlize.v8 运行完成[0.021372s].
[2021-12-29 20:48:18.054508] INFO: moduleinvoker: dl_layer_maxpooling1d.v1 运行完成[0.010611s].
[2021-12-29 20:48:18.060816] INFO: moduleinvoker: winsorize.v6 开始运行..
[2021-12-29 20:48:18.070617] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.072931] INFO: moduleinvoker: winsorize.v6 运行完成[0.012115s].
[2021-12-29 20:48:18.078717] INFO: moduleinvoker: winsorize.v6 开始运行..
[2021-12-29 20:48:18.096708] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.099055] INFO: moduleinvoker: winsorize.v6 运行完成[0.02032s].
[2021-12-29 20:48:18.129432] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.023638s].
[2021-12-29 20:48:18.142401] INFO: moduleinvoker: fillnan.v1 开始运行..
[2021-12-29 20:48:18.154771] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.156803] INFO: moduleinvoker: fillnan.v1 运行完成[0.014413s].
[2021-12-29 20:48:18.165807] INFO: moduleinvoker: fillnan.v1 开始运行..
[2021-12-29 20:48:18.174056] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.175979] INFO: moduleinvoker: fillnan.v1 运行完成[0.010169s].
[2021-12-29 20:48:18.204970] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.021414s].
[2021-12-29 20:48:18.217000] INFO: moduleinvoker: join.v3 开始运行..
[2021-12-29 20:48:18.229104] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.231369] INFO: moduleinvoker: join.v3 运行完成[0.014353s].
[2021-12-29 20:48:18.253596] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-12-29 20:48:18.263183] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.266917] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.013335s].
[2021-12-29 20:48:18.320862] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.023186s].
[2021-12-29 20:48:18.350035] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-12-29 20:48:18.362655] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.364465] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.014467s].
[2021-12-29 20:48:18.376897] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:48:18.385685] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.387451] INFO: moduleinvoker: cached.v3 运行完成[0.01057s].
[2021-12-29 20:48:18.420976] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.02529s].
[2021-12-29 20:48:18.437496] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:48:18.454302] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.456556] INFO: moduleinvoker: cached.v3 运行完成[0.019086s].
[2021-12-29 20:48:18.490882] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.026559s].
[2021-12-29 20:48:18.524134] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.021874s].
[2021-12-29 20:48:18.561099] INFO: moduleinvoker: dl_layer_batchnormalization.v1 运行完成[0.025922s].
[2021-12-29 20:48:18.590005] INFO: moduleinvoker: dl_layer_conv1d.v1 运行完成[0.021551s].
[2021-12-29 20:48:18.602595] INFO: moduleinvoker: dl_layer_add.v1 运行完成[0.00557s].
[2021-12-29 20:48:18.616322] INFO: moduleinvoker: dl_layer_globalmaxpooling1d.v1 运行完成[0.006425s].
[2021-12-29 20:48:18.633423] INFO: moduleinvoker: dl_layer_dropout.v1 运行完成[0.006582s].
[2021-12-29 20:48:18.655197] INFO: moduleinvoker: dl_layer_dense.v1 运行完成[0.013008s].
[2021-12-29 20:48:18.753530] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:48:18.765609] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:48:18.767659] INFO: moduleinvoker: cached.v3 运行完成[0.014146s].
[2021-12-29 20:48:18.769812] INFO: moduleinvoker: dl_model_init.v1 运行完成[0.108621s].
[2021-12-29 20:48:18.774276] INFO: moduleinvoker: dl_model_train.v1 开始运行..
[2021-12-29 20:48:21.656332] INFO: dl_model_train: 准备训练,训练样本个数:734484,迭代次数:10000
[2021-12-29 20:56:47.088142] INFO: dl_model_train: 训练结束,耗时:505.43s
[2021-12-29 20:56:47.157298] INFO: moduleinvoker: dl_model_train.v1 运行完成[508.382998s].
[2021-12-29 20:56:47.167526] INFO: moduleinvoker: dl_model_predict.v1 开始运行..
[2021-12-29 20:56:55.954774] INFO: moduleinvoker: dl_model_predict.v1 运行完成[8.787271s].
[2021-12-29 20:56:55.972263] INFO: moduleinvoker: cached.v3 开始运行..
[2021-12-29 20:56:59.185150] INFO: moduleinvoker: cached.v3 运行完成[3.212893s].
[2021-12-29 20:56:59.265490] INFO: moduleinvoker: backtest.v8 开始运行..
[2021-12-29 20:56:59.271853] INFO: backtest: biglearning backtest:V8.6.1
[2021-12-29 20:56:59.273302] INFO: backtest: product_type:stock by specified
[2021-12-29 20:56:59.446281] INFO: moduleinvoker: cached.v2 开始运行..
[2021-12-29 20:56:59.456039] INFO: moduleinvoker: 命中缓存
[2021-12-29 20:56:59.457871] INFO: moduleinvoker: cached.v2 运行完成[0.011604s].
[2021-12-29 20:57:04.146058] INFO: algo: TradingAlgorithm V1.8.6
[2021-12-29 20:57:05.927939] INFO: algo: trading transform...
[2021-12-29 20:58:08.962354] INFO: Performance: Simulated 912 trading days out of 912.
[2021-12-29 20:58:08.964475] INFO: Performance: first open: 2018-01-02 09:30:00+00:00
[2021-12-29 20:58:08.966250] INFO: Performance: last close: 2021-09-30 15:00:00+00:00
[2021-12-29 20:58:25.931390] INFO: moduleinvoker: backtest.v8 运行完成[86.665895s].
[2021-12-29 20:58:25.944577] INFO: moduleinvoker: trade.v4 运行完成[86.74901s].
[2021-12-29 20:58:25.947902] INFO: moduleinvoker: hyper_parameter_search.v1 运行完成[1693.672087s].