![](/img/trans.png)
[英]How to detect the next open/close of a candlestick that doesn't go through a wick of another candle in PineScript?
[英]Is there a way to detect the price of a candle +/- a certain % from the open or close?
我試圖檢測看漲/看跌吞沒蠟燭,兩邊都有一點擺動空間,因為價格有時會出現小的差異。 即使蠟燭打開/關閉與之前的打開/關閉相比 +/-.01%,我也想檢測到吞沒。
//identify bullish/bearish engulfing candles
bullishEC = close > open[1] and open <= close[1] and close[1] < open[1]
bearishEC = close < open[1] and open >= close[1] and close[1] > open[1]
您可以將 open[1] 和 close[1] 乘以所需的價格百分比,然后進行比較。 例子
bullishEC = close > open[1]*(1-0.01/100) and open <= close[1]*(1+0.01/100) and close[1] < open[1]
bearishEC = close < open[1]*(1+0.01/100) and open >= close[1]*(1-0.01/100) and close[1] > open[1]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.