C_BullHar_BearHar (Function)
The C_BullHar_BearHar function identifies occurrences of two Japanese candlestick patterns; Bullish Harami and Bearish Harami .
Bullish Harami is defined as:
-
The body of a green candle is smaller and inside the body of a red candle on the previous bar
-
The price trend is declining
-
The body of the previous red candle is greater than the average body
Bearish Harami is defined as:
-
The body of a red candle is smaller and inside the body of a green candle on the previous bar
-
The price trend is advancing
-
The body of the previous green candle is greater than the average body
Syntax
C_BullHar_BearHar(Length, oBullishHarami, oBearishHarami)
Returns (Integer)
Each pattern is represented by an output parameter (oBullishHarami or oBearishHarami) 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_BullHar_BearHar function itself returns a value of 1.
Parameters
Name | Type | Description |
Length | Numeric | Length used to calculate the average body. |
oBullishHarami | Numeric | Output variable returns a 1 if the Bullish Harami candlestick pattern exists on the current bar, or 0 if the pattern does not exist. |
oBearishHarami | Numeric | Output variable returns a 1 if the Bearish Harami candlestick pattern exists on the current bar, or 0 if the pattern does not exist. |
Example
Plots a ShowMe on the High of the current bar when a Bullish Harami candlestick pattern is found on the current bar based on a Length of 14:
Value1 = C_BullHar_BearHar(14, oBullishHarami, oBearishHarami)
if oBullishHarami = 1 then
Plot1(High, "Bullish Harami");