数字货币dogeusdt python mt5 api 下单失败 新评论 shoutian shao 2024.10.31 04:10 背景介绍 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)); 通过MQL5社区和服务探索MetaTrader 5的新机遇 www.mql5.com 登录MQL5.com网站 Checking and sending a trade order How to close a position from a webhook MetaTrader 5 Python User Group - how to use Python in Metatrader 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
背景介绍
bybit关联账户
服务器 Bybit-Live
windows 电脑
python运行ide:vscode
电脑端和手机端都可以正常下单
可以查询资金和持仓,但下单失败。
希望各位朋友帮我看看,找找原因,万分感谢大家!~~~~
下单代码
print('==='*5, mt5.positions_total() )