繁体   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