问答交流

如何动态设置买卖时间

由yf_216220创建,最终由yf_216220 被浏览 12 用户

在trade中可以设置

order_price_field_buy='open',
order_price_field_sell='close',

但是如果想在

m19_handle_data_bigquant_run中动态设置,应该用什么接口??

\

评论
  • 可以在回测时候在m19_handle_data_bigquant_run函数里加上 from zipline.assets import Equity context.blotter._get_slippage_model(Equity).price_field_buy = "" context.blotter._get_slippage_model(Equity).price_field_sell = "" 就可以实现每天动态设定买卖点
  • 用这种方式是否可以呢? context.order_target(context.symbol(instrument), 0,order_price_field='close'),是不是一样的?
{link}