簡體   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