请教下:
在主循环里执行以下语句,有时下单正常,但有时候会重复下单!感觉account.frozen_margin没更新一样?
if (account.frozen_margin+account.margin) <= 0 and (now_date<“14:55″ or now_date>”21:00″):
trNum = 1
order=api.insert_order(symbol=symbol1, direction=”BUY”, offset=”OPEN”, volume=trNum, limit_price=price1)
order=api.insert_order(symbol=symbol2, direction=”SELL”, offset=”OPEN”, volume=trNum, limit_price=price2)
api.wait_update()
time.sleep(1)