简体   繁体   English

有没有办法从开盘或收盘检测蜡烛的价格+/-某个百分比?

[英]Is there a way to detect the price of a candle +/- a certain % from the open or close?

I'm trying to detect bullish/bearish engulfing candles with a bit of wiggle room on either side, as there are sometimes small discrepancies in the price(s).我试图检测看涨/看跌吞没蜡烛,两边都有一点摆动空间,因为价格有时会出现小的差异。 I'd like to detect an engulfing even if the candle open/close is say +/-.01% from the previous open/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]

You can multiply the open[1] and close[1] with required price percentage and then compare.您可以将 open[1] 和 close[1] 乘以所需的价格百分比,然后进行比较。 Example例子

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.

相关问题 如何检测未通过 PineScript 中另一根蜡烛灯芯的烛台的下一个打开/关闭? - How to detect the next open/close of a candlestick that doesn't go through a wick of another candle in PineScript? Tradingview 回测能否做空蜡烛的开盘价? - is Tradingview backtesting able to short on open price of the candle? Pine Script Strategy - 当*price*(未收盘)超过某个值时如何触发入场? 目前进入交易一根蜡烛为时已晚 - Pine Script Strategy - How to trigger entry when *price* (not close) crosses a certain value? Currently entering trade one candle too late 有没有办法用我的鼠标按下蜡烛并查看灯芯的高低价格? - is there a way to press a candle with my mouse and see the high and low price in wicks? Plot 红色蜡烛在低于蜡烛中点 50% 处开盘和收盘 - Plot red candle open and close at or below 50% below mid point of candle 如何检测过去'n'支蜡烛是否满足特定要求? - How to detect if in ANY candle in the past 'n' candles meet a certain requirement? 如何 plot 最后打开或关闭当前蜡烛作为一个圆圈通过检查蜡烛 [1] 的信号 - How to plot last Open or Close on current candle as a Circle by checking candle[1] for signal 首支蜡烛收盘价 - First Candle closing price 实时查询蜡烛价格 - Query the price of a candle in real time Pinescript:画出交叉蜡烛的价格 - Pinescript: Paint the price of crossover candle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM