无法在TradingView Pinescript中添加当前警报价格

发布于 2025-01-29 11:44:45 字数 456 浏览 2 评论 0原文

我找不到价格条件的相关解决方案 image link

plotshape(longCondition, title="Buy Signal", text="BUY", textcolor=color.white, style=shape.labelup, size=size.normal, location=location.belowbar, color=color.green, transp=0)


alertcondition(longCondition, title="Buy Alert", message="BUY")

我想要的是我当时会收到购买信号,无论目前的价格是什么,我想在图表中显示出当前的价格,这些价格应该导致这样的东西

i am unable to find the relevant solution for the price condition image link

plotshape(longCondition, title="Buy Signal", text="BUY", textcolor=color.white, style=shape.labelup, size=size.normal, location=location.belowbar, color=color.green, transp=0)


alertcondition(longCondition, title="Buy Alert", message="BUY")

what i want is that when ever i will get buy signal at that time the whatever the current price is i want to show that current price with buy label in the chart that should result something like this finalresultimage link

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

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

发布评论

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

评论(1

风吹雨成花 2025-02-05 11:44:45

栏关闭时,Pine脚本会运行。因此,当您在购买触发时获得的当前价格等于关闭。请记住,默认情况下,这将不是您将进入该职位的价格。您将进入下一个栏的第一个交易的职位(这将是下一个bar的)。

如果要在每个购买触发器上添加Close价格,只需将其添加到text paramater上的plotshape()功能。 V5上的示例:

text="BUY: " + str.tostring(close)

Pine script runs when bar is closed. Therefore, the current price when you get when buy is triggered is equal to close. Keep in mind that as a default, this will not be the price you will enter the position. You will enter a position on the first trade of the next bar (which will be open of the next bar).

If you want to add close price to each buy trigger, just add it to the text paramater on plotshape() function. Example on v5:

text="BUY: " + str.tostring(close)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文