簡體   English   中英

有沒有辦法從開盤或收盤檢測蠟燭的價格+/-某個百分比?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM