根据如何实现日内网格交易官方文档报错,如何解决
由huasan123创建,最终由small_q 被浏览 13 用户
根据《如何实现日内网格交易》https://bigquant.com/wiki/doc/wangge-xGIO8lPjBE,提供的策略代码报错,请问如何修改:
AssertionError Traceback (most recent call last) <ipython-input-1-de148aabc051> in <module> 153 ) 154 --> 155 m2 = M.hftrade.v2( 156 instruments=m1.data, 157 start_date='',
<ipython-input-1-de148aabc051> in m2_handle_data_bigquant_run(context, data) 45 context.write_log(msg, stdout=1) #输出关键日志 46 if(position_short.current_qty != 0): ---> 47 rv = context.buy_close(context.ins, position_short.avail_qty, price, order_type=OrderType.MARKET) 48 msg = "{} 尾盘平空 for {} 最新价={} 下单函数返回={}".format(str(data.current_dt),context.ins,str(price),str(rv)) 49 context.write_log(msg, stdout=1) #输出关键日志
AssertionError: buy_close() invalid volume:0
https://bigquant.com/experimentshare/c0e129eb87a040eeb9ca85b6c30385d5
\