156 views
0

1.每天8:59出来的仓位数据有问题,比如有昨仓10手,今天position.pos_long会显示双倍,今仓昨仓各10手

2.下面的代码 有昨仓和今仓情况下两个order都会执行吗?

if position.pos_long_today>0:
                        print('满足条件【平今多】')
                        order = api.insert_order(symbol=SYMBOL, direction="SELL", offset='CLOSETODAY', volume=position.pos_long_today, limit_price=ticks.bid_price1.iloc[-1])
                    if position.pos_long_his>0:
                        print('满足条件【tick平昨多】')
                        order = api.insert_order(symbol=SYMBOL, direction="SELL", offset='CLOSE', volume=position.pos_long_his, limit_price=ticks.bid_price1.iloc[-1])

Unselected an answer
0

1.请问第一个问题能重现吗,还是只能在8:59那一分钟重现?

2.如果有昨仓和今仓,那么两个条件都能满足,就会进入两个if条件中并调用insert_order()函数发送下单指令

Posted new comment

1.必现,每天开盘的第一根k