简体   繁体   English

如何在 Pinescript 中确认 3 次后创建警报

[英]How to create an alert after 3 confirmations in Pinescript

Cross shapes means to sell交叉形状意味着出售

Hi all, I have created an indicator, but I'm stuck on how I can create a buy/sell alert after 3 orange cross.大家好,我已经创建了一个指标,但我不知道如何在 3 个橙色交叉后创建买入/卖出警报。 Can someone help me with the condition?有人可以帮我解决这个问题吗? Thank you!谢谢!

long = longCondition1 and ta.barssince(longCondition1) < 2 and ta.barssince(longCondition1) < 3
plotshape(long, location=location.belowbar, style=shape.cross, size=size.tiny, color=color.rgb(255,192,203))

I used it but it's not following the condition that it should be plotted after 3 orange cross.我使用了它,但它没有遵循应该在 3 个橙色十字之后绘制的条件。

If you want to create an alert after three orange crosses in a row, you can do it as follows:如果要在连续三个橙色十字后创建警报,可以按如下方式进行:

long = longCondition1 and longCondition1[1] and longCondition1[2]

If you want just the first three then your code should look like this:如果您只想要前三个,那么您的代码应如下所示:

long = longCondition1 and longCondition1[1] and longCondition1[2] and not longCondition1[3]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM