Class TechnicalIndicators
java.lang.Object
org.episteme.social.economics.analysis.TechnicalIndicators
Technical Analysis Indicators for financial markets.
Provides calculations for common market indicators used in algorithmic
trading
and market analysis.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic Real[]bollingerBands(List<FinancialMarketReader.Candle> candles, int period, double stdMultiplier) static Real[]bollingerBands(List<FinancialMarketReader.Candle> candles, int period, Real stdMultiplier) Calculates Bollinger Bands (upper, middle, lower).static booleanisBelowSMA(List<FinancialMarketReader.Candle> candles, int smaPeriod, double threshold) static booleanisBelowSMA(List<FinancialMarketReader.Candle> candles, int smaPeriod, Real threshold) Detects if current price is significantly below SMA (bearish signal).static RealpercentChange(List<FinancialMarketReader.Candle> candles) Calculates the percentage change from the first to the last candle.static Realrsi(List<FinancialMarketReader.Candle> candles, int period) Calculates the Relative Strength Index (RSI).static Realsma(List<FinancialMarketReader.Candle> candles, int period) Calculates the Simple Moving Average (SMA) of closing prices.static Realvolatility(List<FinancialMarketReader.Candle> candles, int period) Calculates the volatility (standard deviation of returns) over a period.
-
Method Details
-
sma
Calculates the Simple Moving Average (SMA) of closing prices.- Parameters:
candles- Price dataperiod- Number of periods for the average- Returns:
- SMA value, or null if insufficient data
-
volatility
Calculates the volatility (standard deviation of returns) over a period.- Parameters:
candles- Price dataperiod- Number of periods- Returns:
- Volatility as standard deviation, or null if insufficient data
-
rsi
Calculates the Relative Strength Index (RSI). RSI invalid input: '<' 30 indicates oversold, RSI > 70 indicates overbought.- Parameters:
candles- Price dataperiod- Number of periods (typically 14)- Returns:
- RSI value (0-100), or null if insufficient data
-
bollingerBands
public static Real[] bollingerBands(List<FinancialMarketReader.Candle> candles, int period, Real stdMultiplier) Calculates Bollinger Bands (upper, middle, lower).- Parameters:
candles- Price dataperiod- SMA period (typically 20)stdMultiplier- Standard deviation multiplier (typically 2)- Returns:
- Array of [lower, middle, upper] bands, or null if insufficient data
-
bollingerBands
public static Real[] bollingerBands(List<FinancialMarketReader.Candle> candles, int period, double stdMultiplier) -
percentChange
Calculates the percentage change from the first to the last candle.- Parameters:
candles- Price data- Returns:
- Percentage change, or null if insufficient data
-
isBelowSMA
public static boolean isBelowSMA(List<FinancialMarketReader.Candle> candles, int smaPeriod, Real threshold) Detects if current price is significantly below SMA (bearish signal).- Parameters:
candles- Price datasmaPeriod- SMA periodthreshold- Percentage below SMA to trigger (e.g., 0.05 = 5%)- Returns:
- true if price is significantly below SMA
-
isBelowSMA
public static boolean isBelowSMA(List<FinancialMarketReader.Candle> candles, int smaPeriod, double threshold)
-