Expand description
Technical analysis indicators for trading. Each indicator is gated behind a Cargo feature flag so you only compile what you need.
§Feature Flags
| Feature | Module | Description |
|---|---|---|
median_price | median_price | (high + low) / 2 |
tr | true_range | True Range volatility measure |
wf | williams_fractals | Williams Fractals |
sma | simple_moving_average | Simple Moving Average |
smma | smoothed_moving_average | Smoothed Moving Average |
ema | exponential_moving_average | Exponential Moving Average |
rma | running_moving_average | Running Moving Average (Wilder’s) |
wma | weighted_moving_average | Weighted Moving Average |
atr | average_true_range | Average True Range (auto-enables tr, sma, smma, ema, rma, wma) |
macd | moving_average_convergence_divergence | MACD (auto-enables ema) |
supertrend | supertrend | Supertrend indicator |
Use the dev feature to enable all indicators:
[dependencies]
qtrade-indicators = { version = "0.1", features = ["dev"] }§Indicator Enum
The Indicator enum provides a named identifier for each available indicator.
use qtrade_indicators::Indicator;
let name = Indicator::AverageTrueRange.to_string();
assert_eq!(name, "Average True Range");Modules§
- indicator_
error - Shared error type used uniformly by all indicator calculation functions.
Defines the
IndicatorErrorenum returned by everycalculate_*function in this crate.