Home | Trading Alchemy Manual | Alchemy Functions IndexAlchemyDualDiverge (Function)The AlchemyDualDiverge function detects bullish and bearish divergence as follows: The function searches for and finds occurrences of highs in prices (i.e., High, Close, etc.) not accompanied by highs in an oscillator (i.e., RSI, Percent R, SlowD). If the criteria of the Bearish Divergence function is met, a -1 will be returned; if it has not been met, a 0 will be returned. Vice versa, the function searches for and finds occurrences of lows in prices (i.e., Low, Close, etc.) not accompanied by lows in an oscillator (i.e., RSI, Percent R, SlowD). If the criteria of the Bullish Divergence function is met, a +1 will be returned; if it has not been met, a 0 will be returned. This function contains the feature of being able to spot either regular divergence or reverse divergence. AlchemyDualDiverge (Occur,BearPrice,BullPrice,Osc,OVBOVS,OverB,OverS,Cycles,OverSCyc,OverBCyc,MinPos,MinNeg,Strength,Length,DivFact,ReverseDiv) Parameters
|
Occur (NumericSimple) |
Specifies which occurrence (that is, 1 = most recent, 2 = 2nd most recent, and so on. |
BearPrice (NumericSeries) |
Specifies which price of the asset of interest is to be used to detect bearish divergence |
BearPrice (NumericSeries) | Specifies which price of the asset of interest is to be used to detect bullish divergence |
Osc (NumericSeries) |
Specifies the indicator applied to the asset of interest |
OVBOVS (TrueFalse) | Enables/disables the overbought/oversold criteria. |
OverB (NumericSimple) | Specifies the overbought value in which to look for bearish divergence. A negative setting disables the overbought requirement |
OverS (NumericSimple) | Specifies the oversold value in which to look for bullish divergence. A negative setting disables the oversold requirement |
Cycles (TrueFalse) | Enables/disables the cycle criteria. |
OverSCyc (NumericSimple) | Specifies the minimum oversold value for the oscillator to reach to qualify for one full cycle from oversold to overbought territory. A full cycle must be completed before a next bearish divergence. A negative setting disables the overbought to oversold cycle requirement. |
OverBCyc (NumericSimple) | Specifies the minimum overbought value for the oscillator to reach to qualify for one full cycle from overbought to oversold territory. A full cycle must be completed before a next bullish divergence. A negative setting disables the oversold to overbought cycle requirement. |
MinPos | Specifies minimum positive value in which to look for bearish divergence. A negative setting disables this requirement |
MinNeg | Specifies maximum negative value in which to look for bullish divergence. A negative setting disables this requirement |
Strength | Specifies the required number of bars on either side to determine a swing point. |
Length |
Specifies the number of trailing bars to consider |
DivFact |
Specifies the minimum amount by which the divergent oscillator needs to fail the oscillator pivot it is compared to. |
ReverseDiv | ReverseDiv set to true, spots reverse divergence as defined by lower price highs accompanied by higher indicator highs or higher price lows accompanied by lower indicator lows. |
ReturnsAlchemyDualDiverge returns -1 when bearish divergence is found, +1 when bullish divergence is found, otherwise it returns 0. UsageThe AlchemyDualDiverge function checks for corresponding swing points between two values and evaluates if the most recent swing values are moving in opposite directions. |