Function ad

Source
pub fn ad(
    high: &Vec<f64>,
    low: &Vec<f64>,
    close: &Vec<f64>,
    volume: &Vec<f64>,
) -> (Vec<f64>, TA_Integer)
Expand description

TA_AD - Chaikin A/D Line

Input = High, Low, Close, Volume Output = double #Sample

let close_prices: Vec<f64> = vec![
       1.087010, 1.087120, 1.087080, 1.087170, 1.087110, 1.087010, 1.087100, 1.087120, 1.087110,
       1.087080, 1.087000, 1.086630, 1.086630, 1.086610, 1.086630, 1.086640, 1.086650, 1.086650,
       1.086670, 1.086630,
];
let high_prices = close_prices.clone();
let low_prices = close_prices.clone();
let volume = close_prices.clone();
let (outs, begin) = rust_ta_lib::wrapper::ad( &high_prices,&low_prices,&close_prices,&volume);
for (index, value) in outs.iter().enumerate() {
       println!("outs index {} = {}", begin + index as i32 + 1, value);
 }