Class SimpleMovingAverageIndicator
java.lang.Object
com.bluebell.greenhouse.radicle.services.technical.indicators.impl.SimpleMovingAverageIndicator
- All Implemented Interfaces:
TechnicalIndicator
@Component("simpleMovingAverageIndicator")
public class SimpleMovingAverageIndicator
extends Object
implements TechnicalIndicator
A Simple Moving Average (SMA) calculates the average price of an asset, typically closing prices,
over a selected. number of time periods, smoothing out price volatility and revealing trends. The
formula for calculating an SMA involves summing the asset's prices over the chosen period and
dividing by the number of periods. Source
- Version:
- 1.0.12
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComputes the indicator values for the given market prices and input parameters.Returns theIndicatorType.
-
Constructor Details
-
SimpleMovingAverageIndicator
public SimpleMovingAverageIndicator()
-
-
Method Details
-
compute
@Transactional public List<IndicatorValue> compute(List<MarketPrice> marketPrices, Map<String, Object> inputParameters, boolean commit) Computes the indicator values for the given market prices and input parameters.- Specified by:
computein interfaceTechnicalIndicator- Parameters:
marketPrices-ListofMarketPriceinputParameters- input parameterscommit- if true, will save the computed values to the database- Returns:
ListofIndicatorValue
-
getIndicator
Returns theIndicatorType.- Specified by:
getIndicatorin interfaceTechnicalIndicator- Returns:
IndicatorType
-