if (datetime.now().strftime("%H:%M") in timelist.timelist.values) :
if open_position(quota2_klines):
position_check1 = api.get_position(main_contract)
getorder=tq_kq.get_order()
# no holding and no unfinished long order
#(getorder == {} | ((getorder.status == 'ALIVE') & (getorder.offset != "OPEN")))
if (position_check1.pos_long_today==0) and (getorder == {} | ((getorder.status == 'ALIVE') & (getorder.offset != "OPEN"))):
print("send order")
quote = api.get_quote(main_contract)
order = api.insert_order(symbol=main_contract, direction="BUY", offset="OPEN", limit_price=quote.ask_price1,
volume=1)
谢谢
李思恒 已回答的问题 2024年3月14日