Skip to main content

Crate qtrade_indicators

Crate qtrade_indicators 

Source
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

FeatureModuleDescription
median_pricemedian_price(high + low) / 2
trtrue_rangeTrue Range volatility measure
wfwilliams_fractalsWilliams Fractals
smasimple_moving_averageSimple Moving Average
smmasmoothed_moving_averageSmoothed Moving Average
emaexponential_moving_averageExponential Moving Average
rmarunning_moving_averageRunning Moving Average (Wilder’s)
wmaweighted_moving_averageWeighted Moving Average
atraverage_true_rangeAverage True Range (auto-enables tr, sma, smma, ema, rma, wma)
macdmoving_average_convergence_divergenceMACD (auto-enables ema)
supertrendsupertrendSupertrend 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 IndicatorError enum returned by every calculate_* function in this crate.

Enums§

Indicator