Class SymbolAnalysis
java.lang.Object
com.bluebell.greenhouse.anther.models.analysis.SymbolAnalysis
-
Constructor Summary
ConstructorsConstructorDescriptionSymbolAnalysis(LocalDate start, LocalDate end, SymbolAlias symbolAlias, MarketTimeInterval timeInterval, SortedSet<MarketPrice> prices) Primary constructor. -
Method Summary
Modifier and TypeMethodDescriptioncalculate(SortedSet<MarketPrice> prices) Calculates the highs and lows and average changes.Calculates directional information related to the bars.calculateWicks(SortedSet<MarketPrice> prices) Calculates the average bull and bear wick sizes (distance of the high/low from the open.doubleReturns the absolute high of the analysis period.doubleReturns the absolute low of the analysis period.doubleReturns the average gain for bearish periods.doubleReturns the average wick size for a bearish period.doubleReturns the average gain for bullish periods.doubleReturns the average wick size for a bullish period.doubleReturns the average change in highs & lows of the analysis period.intReturns the count of bearish periods.intReturns the probability of a bearish period.intReturns the count of bullish periods.intReturns the probability of a bullish period.intReturns the number of periods in the analysis period.intReturns the count of doji periods.intReturns the probability of a doji period.toString()Defines a custom toString().
-
Constructor Details
-
SymbolAnalysis
public SymbolAnalysis(LocalDate start, LocalDate end, SymbolAlias symbolAlias, MarketTimeInterval timeInterval, SortedSet<MarketPrice> prices) Primary constructor.- Parameters:
start- start of time periodend- end of time periodsymbolAlias-SymbolAliastimeInterval-MarketTimeIntervalprices-SortedSetofMarketPrice
-
-
Method Details
-
getCountOfPeriods
public int getCountOfPeriods()Returns the number of periods in the analysis period.- Returns:
- integer
-
getAbsoluteHigh
public double getAbsoluteHigh()Returns the absolute high of the analysis period.- Returns:
- double
-
getAbsoluteLow
public double getAbsoluteLow()Returns the absolute low of the analysis period.- Returns:
- double
-
getAverageChange
public double getAverageChange()Returns the average change in highs & lows of the analysis period.- Returns:
- double
-
getAverageBullWickSize
public double getAverageBullWickSize()Returns the average wick size for a bullish period.- Returns:
- double
-
getAverageBearWickSize
public double getAverageBearWickSize()Returns the average wick size for a bearish period.- Returns:
- double
-
getBullDays
public int getBullDays()Returns the count of bullish periods.- Returns:
- integer
-
getAverageBullGain
public double getAverageBullGain()Returns the average gain for bullish periods.- Returns:
- double
-
getBearDays
public int getBearDays()Returns the count of bearish periods.- Returns:
- integer
-
getAverageBearGain
public double getAverageBearGain()Returns the average gain for bearish periods.- Returns:
- double
-
getDojiDays
public int getDojiDays()Returns the count of doji periods.- Returns:
- integer
-
getBullProbability
public int getBullProbability()Returns the probability of a bullish period.- Returns:
- percentage
-
getBearProbability
public int getBearProbability()Returns the probability of a bearish period.- Returns:
- percentage
-
getDojiProbability
public int getDojiProbability()Returns the probability of a doji period.- Returns:
- percentage
-
toString
-
calculate
Calculates the highs and lows and average changes.- Parameters:
prices- market prices- Returns:
Triplet
-
calculateWicks
Calculates the average bull and bear wick sizes (distance of the high/low from the open.- Parameters:
prices- market prices- Returns:
Pair
-
calculateDirectionalInformation
-