您如何实施定时限额订单?
我想到了这个管道:
1. condition to enter a trade becomes TRUE
2. opens a limit order at a pre-calculated price
3. wait 3 bar closes (or 3 hours, for example. variable.)
4. if the order has not filled, cancel the order
特别是,如何实施步骤 3-4?
I have this pipeline in mind:
1. condition to enter a trade becomes TRUE
2. opens a limit order at a pre-calculated price
3. wait 3 bar closes (or 3 hours, for example. variable.)
4. if the order has not filled, cancel the order
Particularly, how can steps 3-4 be implemented?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用内置策略。Cancel()函数取消待处理限制顺序,检查长期3个bars的条件是否在3个bars之前并取消订单,以防万一填充 - 不会受到影响。
下面的脚本将触发条件长时间使用鼠标单击图表,其中给定的限制值以限制顺序,并取消订单,以防下一个3个bars中执行:
You can cancel the pending limit order using the built-in strategy.cancel() function, check if the condition for long was true 3 bars ago and cancel the order, in case it was filled - it will be not affected.
The script below will trigger a condition to go long using a mouse click on the chart, with a given limitValue for limit order and cancel the order in case it will not be executed during next 3 bars: