创建看涨吞没蜡烛脚本
Creating a Bullish engulfing candle script
刚开始使用 Pine Script 和一般编码。我发现了几个开源脚本,它们能够在出现吞没看涨蜡烛时发出买入信号。有没有办法对其进行编码,以便必须首先有 3 根看跌蜡烛,然后是一根看涨蜡烛才能发出买入信号?图 1 显示了我想要的东西,有 3 支红色蜡烛,然后发出买入信号。图 2 显示只有一根红色蜡烛,然后是一根表示买入的看涨蜡烛。
![1]: https://i.stack.imgur.com/vepsW.png
![2]: https://i.stack.imgur.com/uwMMI.png
threeRed = close[1] < open[1] and close[2] < open[2] and close[3] < open[3]
oneRed = close[1] < open[1]
bullishEng = close > open and close > max(open[1], close[1])
buySignal1 = oneRed and bullishEng and not threeRed
buySignal3 = threeRed and bullishEng
刚开始使用 Pine Script 和一般编码。我发现了几个开源脚本,它们能够在出现吞没看涨蜡烛时发出买入信号。有没有办法对其进行编码,以便必须首先有 3 根看跌蜡烛,然后是一根看涨蜡烛才能发出买入信号?图 1 显示了我想要的东西,有 3 支红色蜡烛,然后发出买入信号。图 2 显示只有一根红色蜡烛,然后是一根表示买入的看涨蜡烛。
![1]: https://i.stack.imgur.com/vepsW.png ![2]: https://i.stack.imgur.com/uwMMI.png
threeRed = close[1] < open[1] and close[2] < open[2] and close[3] < open[3]
oneRed = close[1] < open[1]
bullishEng = close > open and close > max(open[1], close[1])
buySignal1 = oneRed and bullishEng and not threeRed
buySignal3 = threeRed and bullishEng