如何使用 PineScript 与 14:50 的最新图表进行交易?

发布于 2025-01-20 09:57:19 字数 64 浏览 4 评论 0 原文

Pine脚本中的默认值是该订单是在购买或出售后在下一个栏上执行的。我希望该命令在同一天14:50执行。我该怎么做?

The default in pine script is that the order is executed at the next bar after the buy or sell is made. I want the order to be executed at 14:50 on the same day. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悲凉≈ 2025-01-27 09:57:19

您可以将 process_orders_on_close 设置 stragity()函数的属性属性 true 如果您希望将订单放在bar上。

然后,您可以使用小时 minute indent-variables来找出时间并执行订单。

另外,您可以定义交易会并在代码中使用它。

timeAllowed = input("1200-1500", "Allowed hours", input.session)

// Check to see if we are in allowed hours using session info on all 7 days of the week.
timeIsAllowed = time(timeframe.period, timeAllowed + ":1234567")

You can set process_orders_on_close property of the strategy() function to true if you want your orders to be placed on bar close.

Then you can use the hour and minute built-variables to figure out the time and execute your order.

Alternatively, you can define a trading session and use it in your code.

timeAllowed = input("1200-1500", "Allowed hours", input.session)

// Check to see if we are in allowed hours using session info on all 7 days of the week.
timeIsAllowed = time(timeframe.period, timeAllowed + ":1234567")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文