Skip to main content

Crate indica

Crate indica 

Source
Expand description

§indica

Fast technical analysis indicators for stock markets. SMA, EMA, RSI, MACD, Bollinger Bands, ATR, Pivot Points, and more.

Modules§

batch

Structs§

BollingerBandsResult
Bollinger Bands result.
MacdResult
MACD computation result.
PivotPointsResult
Classic Pivot Points result.

Enums§

Crossover
MACD crossover direction.

Functions§

atr
Average True Range using Wilder’s smoothing. Requires period + 1 data points minimum. Returns None if insufficient data.
bollinger_bands
Bollinger Bands (default: period=20, std_dev_multiplier=2.0). Returns None if insufficient data.
ema
Exponential Moving Average. Seeded with SMA of the first period values, then smoothed forward. Returns None if there are fewer values than period.
macd
MACD (Moving Average Convergence Divergence). Default parameters: fast=12, slow=26, signal=9. Returns None if insufficient data.
pivot_points
Classic Pivot Points from a single candle (typically previous day).
relative_strength
Relative Strength vs a benchmark (e.g., Nifty 50). RS = 1 + (stock_return - benchmark_return). Returns >1 if outperforming, <1 if underperforming. Returns None if insufficient data.
rsi
Relative Strength Index using Wilder’s smoothing. Default period is typically 14. Returns None if insufficient data (need at least period + 1 values).
sma
Simple Moving Average of the last period values. Returns None if there are fewer values than period.
volume_trend
Classify volume trend by comparing recent 5-day avg to 20-day avg. Returns a static string: “surging”, “increasing”, “stable”, “declining”, “drying up”, or “insufficient data”.