数字货币dogeusdt python mt5 api 下单失败

 

背景介绍

bybit关联账户

服务器 Bybit-Live 

windows 电脑

python运行ide:vscode

电脑端和手机端都可以正常下单

可以查询资金和持仓,但下单失败。

希望各位朋友帮我看看,找找原因,万分感谢大家!~~~~


下单代码 

print('==='*5, mt5.positions_total() )

# 准备买入请求结构
symbol = "DOGEUSDT"
symbol_info = mt5.symbol_info(symbol)
if symbol_info is None:
    print(symbol, "not found, can not call order_check()")
    mt5.shutdown()
    quit()
if not symbol_info.visible:
    print(symbol, "is not visible, trying to switch on")
    if not mt5.symbol_select(symbol,True):
        print("symbol_select({}}) failed, exit",symbol)
        mt5.shutdown()
        quit()
lot = 100
point = mt5.symbol_info(symbol).point
price = mt5.symbol_info_tick(symbol).ask + 0.02
print(lot, point, price )
for tf in [mt5.ORDER_FILLING_RETURN, mt5.ORDER_FILLING_FOK, mt5.ORDER_FILLING_IOC]:
    deviation = 0
    request = {
        "action": mt5.TRADE_ACTION_DEAL,"symbol": symbol,"volume": lot,"type": mt5.ORDER_TYPE_BUY,"price": price,
        # "sl": price - 100 * point,
        # "tp": price + 100 * point,
        # "deviation": deviation,
        "magic": 234000,"comment": "python script open","type_time": mt5.ORDER_TIME_GTC,"type_filling":tf}
    result = mt5.order_send(request)
    print('==============================:',tf)
    import time
    time.sleep(10)
    # # # 检查执行结果
    print("666. order_send(): by {} {} lots at {} with deviation={} points".format(symbol,lot,price,deviation));