BullishDivergence (Function)
The BullishDivergence function identifies lower occurrences of Pivot lows in one value, accompanied by higher Pivot lows in another value. A Pivot Low is a significant low value preceded and proceeded by some number of higher values.
BullishDivergence is normally identified when a price (Low) makes a Pivot low that is lower than the previous Pivot low, and an oscillator (Stochastic, RSI, Bollinger Bands) makes a Pivot low that is higher than the previous Pivot low.
Syntax
BullishDivergence(Price1,Price2,Strength,Length)
Returns (Integer)
The function returns a value of 1 if the BullishDivergence condition is True for the current bar, otherwise it returns 0.
Parameters
Name | Type | Description |
Price1 | Numeric | Specifies which bar value (price, function, or formula) to use for the first pivot point. |
Price2 | Numeric | Specifies which bar value (price, function, or formula) to use for the second pivot point. |
Strength | Numeric | Sets the number of bars on either side of the pivot low point. |
Length | Numeric | Sets the maximum number of bars between pivot low points. |
Remarks
The input parameters Price1 and Price2 can be a bar value such as Close, High, Low, Open, or Volume. They can also be any mathematical calculation such as High + Low) / 2, or a numeric function such as RSI, Stochastic, or ADX.
Increasing the Strength input parameter will normally decrease the number of True occurrences.
Increasing the Length input parameter will normally increase the chances for True of occurrences.
The value for Length and Strength should always be a positive whole number greater than 0.
Example
Plots a ShowMe on the Low when a BullishDivergence occurs between a Pivot Low and the Pivot low of the RSI oscillator on any bar, where the Pivot Strength is 2 and the Pivot Length is 20:
if BullishDivergence(Low, RSI(Close,14), 2, 20) = 1 then
Plot1(Low, "BullDrvg");
Reference
Wilder, Welles, Jr. New Concepts in Technical Trading Systems. Trend Research. McLeansville, NC.