MT5 || Python:X分钟后关闭待处理顺序
我正在使用连接到MT5的Python,并设法加载了使用SL,TP等的待处理顺序。 我现在有问题在30分钟后到期,也许如何将其放在请求部分中?我尝试过MT5.Order_time_specified_day,但什么也没有发生,尽管我更喜欢时间更短的时间倒数。我已经用 *.mq5做到了,但是与python失败了。请帮忙!!!
request = {
'action': mt5.TRADE_ACTION_PENDING,
'symbol': sym,
'volume': LotSize,
'type': signal,
'price': P_price,
'sl': P_SL,
'tp': P_TP,
'comment': '',
'expiration': mt5.ORDER_TIME_SPECIFIED_DAY,
'type_filling': mt5.ORDER_FILLING_RETURN,
}
mt5.order_send(request)
I am using python connected to MT5, and have manage to load pending order with sl, tp, etc.
I am now having problem expiring the pending order after 30 min, maybe, how do I put it in the request section? I have tried mt5.ORDER_TIME_SPECIFIED_DAY but nothing happen, though I prefer a much shorter time countdown. I have done it with *.mq5, but unsuccessful with python. Please help!!!
request = {
'action': mt5.TRADE_ACTION_PENDING,
'symbol': sym,
'volume': LotSize,
'type': signal,
'price': P_price,
'sl': P_SL,
'tp': P_TP,
'comment': '',
'expiration': mt5.ORDER_TIME_SPECIFIED_DAY,
'type_filling': mt5.ORDER_FILLING_RETURN,
}
mt5.order_send(request)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要更改 - >
这需要在时间戳中进行,因此例如,在我的代码中,我将变量放在那里并将其定义在其他地方。然后将其作为额外的参数。或者,您可以在代码中正确定义它,无论您希望
它能有所帮助。
you need to change ->
This needs to be in a timestamp so for example in my code I have put variable there and defined it somewhere else. And then put it as an extra parameter. Or you can define it right in the code, whatever you prefer
Hope it helps..