繁体   English   中英

如何绘制一次形状并在满足另一个条件时停止绘制?

[英]How to plot a shape once and stop plotting while another condition is met?

这是相关的脚本。

lucidSARbullish=L_SAR < close
lucidSARbearish=L_SAR > close
bullishcondition=twohrRSI > 50 and price > lwma[1] and diplus > diminus and macd > signal and hist > 0 and oc == 1 and ruleState == 1 
         and adx > 20 and sqzmombull == true
bearishcondition=twohrRSI < 50 and price < lwma[1] and diplus < diminus and macd < signal and hist < 0 and oc != 1 and ruleState == -1 
         and adx > 20 and sqzmombear == true

按照目前的情况,默认情况下, plot()函数会检查每个柱/周期,如果条件为真,则绘制图表。 我想将lucidSARbearishlucidSARbullish分别绘制为一个黄色三角形(下方为看涨,上方为看跌),但它最终与bullishconditionbearishcondition绘制的形状重叠。

我怎样才能做到当lucidSARbearishlucidSARbullish为真时,它只绘制一次黄色三角形,并且在bullishcondition和/或bearishcondition为真时不再绘制?

提前致谢。

我很笨,但我仍然不完全知道如何让它只绘制一次,然后等待看涨/看跌条件变为真到假再绘制。 虽然不是必需的,但我认为这样会更有用。

lucidSARbullish=L_SAR < close and bullishcondition==false
lucidSARbearish=L_SAR > close and bearishconditon==false

暂无
暂无

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

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