Skip to main content

aroon

Function aroon 

Source
pub fn aroon(highs: &[f64], lows: &[f64], period: usize) -> Result<AroonResult>
Expand description

Calculate Aroon Indicator.

Aroon Up = ((period - periods since highest high) / period) * 100 Aroon Down = ((period - periods since lowest low) / period) * 100

§Arguments

  • highs - High prices
  • lows - Low prices
  • period - Number of periods

§Example

use finance_query::indicators::aroon;

let highs = vec![10.0, 11.0, 12.0, 11.0, 10.0];
let lows = vec![8.0, 9.0, 10.0, 9.0, 8.0];
let result = aroon(&highs, &lows, 3).unwrap();