xmd79

3 Candle Engulfing

Sep 29th, 2021
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. // @version=4
  2. // Three Line Strike Candlestick Pattern (3 candle Engulfing patern) to help you detect sniper entry point mostly for (forex)
  3. // Based on Arty (The moving average) youtube video channel
  4. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  5. // © moamenmostafa based on @amri_pangestu script
  6. study(title = "3 Candle Engulfing", overlay = true)
  7.  
  8. // Inputs
  9. minEngulfPips = input(title="Min. Engulf Pips", type=input.integer, defval=10, minval=1) / 10
  10.  
  11.  
  12. // Logic
  13. isBullEngulf = open[3] > close[3] ? open[2] > close[2] ? open[1] > close[1] ? close > open ? close >= open[1] ? close[1] >= open ? close - open > minEngulfPips ? close - open > open[1] - close[1] ? true :false :false :false :false :false :false :false :false
  14.  
  15. isBearEngulf = open[3] < close[3] ? open[2] < close[2] ? open[1] < close[1] ? open > close ? open >= close[1] ? open[1] >= close ? open - close > minEngulfPips ? open - close > close[1] - open[1] ? true :false :false :false :false :false :false :false :false
  16.  
  17.  
  18. // Graphics
  19. barcolor = isBullEngulf ? color.yellow : isBearEngulf ? color.white : na
  20. barcolor(color = barcolor, title= "Engulf Candle Color")
  21.  
  22. plotshape(isBullEngulf, style=shape.triangleup,
  23. location=location.belowbar, color=color.green, size = size.small, title= "Bull Engulf Mark")
  24. plotshape(isBearEngulf, style=shape.triangledown,
  25. location=location.abovebar, color=color.red, size = size.small, title= "Bear Engulf Mark")
  26.  
  27.  
  28. // Alerts
  29. if (isBullEngulf)
  30. alert(message = "Bullish Engulfing", freq = alert.freq_once_per_bar_close)
  31. if (isBearEngulf)
  32. alert(message = "Bearish Engulfing", freq = alert.freq_once_per_bar_close)
  33.  
Advertisement
Add Comment
Please, Sign In to add comment