C_BullEng_BearEng (Function)
The C_BullEng_BearEng function identifies occurrences of two Japanese candlestick patterns; Bullish Engulfing and Bearish Engulfing.
Bullish Engulfing is defined as:
-
The body of a green candle is larger and engulfs both the open and close of a red candle on the previous bar
-
The price trend is declining
-
The body of the green candle is greater than the average body
Bearish Engulfing is defined as:
-
The body of a red candle is larger and engulfs both the open and close of a green candle on the previous bar
-
The price trend is advancing
-
The body of the red candle is greater than the average body
Syntax
C_BullEng_BearEng(Length, oBullishEngulfing, oBearishEngulfing)
Returns (Integer)
Each pattern is represented by an output parameter (oBullishEngulfing or oBearishEngulfing) that returns a positive one (1) when the matching candlestick pattern is found on the current bar or returns a zero (0) if the pattern is not found. The C_BullEng_BearEng function itself returns a value of 1.
Parameters
Name | Type | Description |
Length | Numeric | Length used to calculate the average body. |
oBullishEngulfing | Numeric | Output variable returns a 1 if the Bullish Engulfing candlestick pattern exists on the current bar, or 0 if the pattern does not exist. |
oBearishEngulfing | Numeric | Output variable returns a 1 if the Bearish Engulfing candlestick pattern exists on the current bar, or 0 if the pattern does not exist. |
Example
Plots a ShowMe on the Low of the current bar when a Bearish Engulfing candlestick pattern is found on the current bar based on a Length of 14:
Value1 = C_BullEng_BearEng(14, oBullishEngulfing, oBearishEngulfing)
if oBearishEngulfing = 1 then
Plot1(Low, "BearishEngulfing");