218 浏览
0
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日
0

这个数据类型处理方法类似于字典套字典,数据处理上的问题应该,可以百度查一下如何处理这类数据

李思恒 已回答的问题 2024年3月14日