TechnicalIndicators

Struct TechnicalIndicators 

Source
pub struct TechnicalIndicators { /* private fields */ }
Expand description

Technical Indicators API endpoints

Implementations§

Source§

impl TechnicalIndicators

Source

pub async fn get_sma( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<SmaData>>

Get Simple Moving Average (SMA)

Returns SMA values for a symbol over specified period.

§Arguments
  • symbol - Stock symbol (e.g., “AAPL”)
  • period - Period for calculation (e.g., 20)
  • from - Start date (optional, format: YYYY-MM-DD)
  • to - End date (optional, format: YYYY-MM-DD)
§Example
let client = FmpClient::new()?;
let sma = client.technical_indicators().get_sma("AAPL", 20, None, None).await?;
for point in sma.iter().take(5) {
    println!("{}: SMA20 = {:.2}", point.date, point.sma.unwrap_or(0.0));
}
Source

pub async fn get_ema( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<EmaData>>

Get Exponential Moving Average (EMA)

Returns EMA values for a symbol over specified period.

§Arguments
  • symbol - Stock symbol
  • period - Period for calculation
  • from - Start date (optional)
  • to - End date (optional)
§Example
let client = FmpClient::new()?;
let ema = client.technical_indicators().get_ema("AAPL", 12, None, None).await?;
for point in ema.iter().take(5) {
    println!("{}: EMA12 = {:.2}", point.date, point.ema.unwrap_or(0.0));
}
Source

pub async fn get_wma( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<WmaData>>

Get Weighted Moving Average (WMA)

Returns WMA values for a symbol over specified period.

§Arguments
  • symbol - Stock symbol
  • period - Period for calculation
  • from - Start date (optional)
  • to - End date (optional)
Source

pub async fn get_dema( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<DemaData>>

Get Double Exponential Moving Average (DEMA)

Source

pub async fn get_tema( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<TemaData>>

Get Triple Exponential Moving Average (TEMA)

Source

pub async fn get_rsi( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<RsiData>>

Get Relative Strength Index (RSI)

Returns RSI values (0-100 scale) for momentum analysis.

§Example
let client = FmpClient::new()?;
let rsi = client.technical_indicators().get_rsi("AAPL", 14, None, None).await?;
for point in rsi.iter().take(5) {
    let rsi_val = point.rsi.unwrap_or(0.0);
    let signal = if rsi_val > 70.0 { "Overbought" }
                 else if rsi_val < 30.0 { "Oversold" }
                 else { "Neutral" };
    println!("{}: RSI = {:.1} ({})", point.date, rsi_val, signal);
}
Source

pub async fn get_adx( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<AdxData>>

Get Average Directional Index (ADX)

Source

pub async fn get_standardized( &self, symbol: &str, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<StandardizedIndicator>>

Get standardized technical data

Source

pub async fn get_williams_r( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<WilliamsRData>>

Get Williams %R indicator

Source

pub async fn get_cci( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<CciData>>

Get Commodity Channel Index (CCI)

Source

pub async fn get_macd( &self, symbol: &str, fast_period: u32, slow_period: u32, signal_period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<MacdData>>

Get MACD (Moving Average Convergence Divergence)

Returns MACD line, signal line, and histogram for trend analysis.

§Example
let client = FmpClient::new()?;
let macd = client.technical_indicators().get_macd("AAPL", 12, 26, 9, None, None).await?;
for point in macd.iter().take(5) {
    if let (Some(macd_val), Some(signal)) = (point.macd, point.signal) {
        let signal_type = if macd_val > signal { "Bullish" } else { "Bearish" };
        println!("{}: MACD={:.3}, Signal={:.3} ({})",
            point.date, macd_val, signal, signal_type);
    }
}
Source

pub async fn get_stochastic( &self, symbol: &str, k_period: u32, d_period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<StochasticData>>

Get Stochastic Oscillator

Source

pub async fn get_bollinger_bands( &self, symbol: &str, period: u32, std_dev: f64, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<BollingerBandsData>>

Get Bollinger Bands

Returns upper band, middle band (SMA), and lower band for volatility analysis.

§Example
let client = FmpClient::new()?;
let bb = client.technical_indicators().get_bollinger_bands("AAPL", 20, 2.0, None, None).await?;
for point in bb.iter().take(5) {
    if let (Some(upper), Some(middle), Some(lower)) =
        (point.upper_band, point.middle_band, point.lower_band) {
        println!("{}: Upper={:.2}, Middle={:.2}, Lower={:.2}",
            point.date, upper, middle, lower);
    }
}
Source

pub async fn get_atr( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<AtrData>>

Get Average True Range (ATR)

Source

pub async fn get_aroon( &self, symbol: &str, period: u32, from: Option<&str>, to: Option<&str>, ) -> Result<Vec<AroonData>>

Get Aroon Indicator

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,