Class RecursiveIndicator<T>
java.lang.Object
trade.invision.indicators.indicators.Indicator<T>
trade.invision.indicators.indicators.CachingIndicator<T>
trade.invision.indicators.indicators.RecursiveIndicator<T>
- Type Parameters:
T- theIndicatortype
- Direct Known Subclasses:
AccumulationDistribution,ExponentialMovingAverage,GlobalBearishPercentage,GlobalBullishPercentage,GlobalFallingPercentage,GlobalMaximum,GlobalMinimum,GlobalRisingPercentage,KaufmansAdaptiveMovingAverage,NegativeVolumeIndex,OnBalanceVolume,PositiveVolumeIndex,Supertrend,SupertrendLowerBand,SupertrendUpperBand,WellesWilderMovingAverage,ZeroLagExponentialMovingAverage
RecursiveIndicator is an abstract CachingIndicator class for Indicator subclasses that use
recursion in the Indicator.calculate(long) method implementation. If getValue(long) is called with an empty
Indicator cache, a StackOverflowError may occur, so this class replaces recursion with iteration.-
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
Constructors -
Method Summary
Methods inherited from class trade.invision.indicators.indicators.Indicator
caching, calculate, getMinimumStableIndex, getSeries, 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
-
RecursiveIndicator
- See Also:
-
-
Method Details
-
getValue
Description copied from class:IndicatorComputes the value of thisIndicatorat the givenindex. Regardless ofIndicator.isCaching(), ifIndicator.getSeries()has not been modified since the previous method call was invoked with the sameindexas the current method call, then thisIndicatordoes not recalculate the value forindexand a cached value is returned. IfIndicator.isCaching()istrue, then the cached value forindexis returned if it has been previously calculated, except ifindexis equal toIndicator.getSeries()Series.getEndIndex()andIndicator.getSeries()has changed, then the value is recalculated and the cache is updated. Ifindexis greater thanIndicator.getSeries()Series.getEndIndex(), then the calculation is attempted, but may throw anIndexOutOfBoundsException. Ifindexis less thanIndicator.getSeries()Series.getStartIndex(), then0is used to avoid calculating on a value that has already been removed fromIndicator.getSeries()and to use thisIndicator's default first value so that aStackOverflowErroris avoided in recursive calculations.
-