PROTECTED SOURCE SCRIPT
TheDu Engulfing + vol20

// Volume filter settings
volumeLength = input.int(20, title="Volume MA Length", minval=1)
volumeThreshold = input.float(1.2, title="Volume Threshold (1.2 = 120%)", minval=1.0, step=0.1)
// Calculate volume moving average
volumeMA = ta.sma(volume, volumeLength)
// Volume condition: current volume > volume MA * threshold
volumeCondition = volume > volumeMA * volumeThreshold
// bullish engulfing with volume filter
bullishEngulfing = open[1] > close[1] ? close > open ? close >= open[1] ? close[1] >= open ? close - open > open[1] - close[1] ? volumeCondition ? color.blue : na : na : na : na : na : na
barcolor(bullishEngulfing)
// bearish engulfing with volume filter
bearishEngulfing = close[1] > open[1] ? open > close ? open >= close[1] ? open[1] >= close ? open - close > close[1] - open[1] ? volumeCondition ? color.purple : na : na : na : na : na : na
barcolor(bearishEngulfing)
alertcondition(bullishEngulfing != na, title='Bullish Engulfing', message='[CurrencyPair] [TimeFrame], Bullish candle engulfing previous candle with high volume')
alertcondition(bearishEngulfing != na, title='Bearish Engulfing', message='[CurrencyPair] [TimeFrame], Bearish candle engulfing previous candle with high volume')
// Optional: Plot volume MA for reference
plot(volumeMA, title="Volume MA", color=color.gray, display=display.none)
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。