Class SimpleConvergenceDivergence
java.lang.Object
trade.invision.indicators.indicators.Indicator<Boolean>
trade.invision.indicators.indicators.convergencedivergence.SimpleConvergenceDivergence
SimpleConvergenceDivergence is a Boolean Indicator to test whether two Num
Indicators converge or diverge over a length of values. "Simple" convergence-divergence uses a
basic evaluation technique that tests if the percentage of values in a timeframe that align with the given
convergence-divergence
type are above a given threshold. This requires less computational power than "complex"
convergence-divergence. Internally, this uses the LocalRisingPercentage and LocalFallingPercentage
Indicators.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class trade.invision.indicators.indicators.Indicator
Indicator.CacheSeries -
Field Summary
Fields inherited from class trade.invision.indicators.indicators.Indicator
cachedAddCallCount, cachedIndex, cachedValue, cacheSeries, minimumStableIndex, series -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleConvergenceDivergence(Indicator<Num> first, Indicator<Num> second, ConvergenceDivergenceType type, int length, Num percentageThreshold) -
Method Summary
Modifier and TypeMethodDescriptionprotected Booleancalculate(long index) Performs the calculation of thisIndicatorat the givenindex.static SimpleConvergenceDivergencesimpleConvergenceDivergence(Indicator<Num> first, Indicator<Num> second, ConvergenceDivergenceType type, int length, Num percentageThreshold) Gets aSimpleConvergenceDivergence.Methods inherited from class trade.invision.indicators.indicators.Indicator
caching, getMinimumStableIndex, getSeries, getValue, isCaching, numOf, numOf, numOf, numOf, numOfEight, numOfFive, numOfFour, numOfHalf, numOfHundred, numOfHundredth, numOfNegativeOne, numOfNine, numOfOne, numOfSeven, numOfSix, numOfTen, numOfTenth, numOfThousand, numOfThousandth, numOfThree, numOfTwo, numOfZero, purgeCache
-
Constructor Details
-
SimpleConvergenceDivergence
-
-
Method Details
-
simpleConvergenceDivergence
public static SimpleConvergenceDivergence simpleConvergenceDivergence(Indicator<Num> first, Indicator<Num> second, ConvergenceDivergenceType type, int length, Num percentageThreshold) Gets aSimpleConvergenceDivergence.- Parameters:
first- the firstIndicatorsecond- the secondIndicatortype- theConvergenceDivergenceTypelength- the number of values to look back atpercentageThreshold- the percentage threshold. The percentage is represented as a fractional. For example, a provided value of0.15would represent15%. Must be between zero and one.
-
calculate
Description copied from class:IndicatorPerforms the calculation of thisIndicatorat the givenindex.
-