Function ultosc

Source
pub fn ultosc(
    high: &Vec<f64>,
    low: &Vec<f64>,
    close: &Vec<f64>,
    timeperiod1: i32,
    timeperiod2: i32,
    timeperiod3: i32,
) -> (Vec<f64>, TA_Integer)
Expand description

TA_ULTOSC - Ultimate Oscillator

Input: high, low, close, timeperiod1, timeperiod2, timeperiod3

Output: (1st, 2nd)

1st: output vector(f64)

2nd: the first index of inputs corresponding to an valid output value

#Sample

let inReal: 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 = inReal.clone();
let low = inReal.clone();
let close = inReal.clone();
let (out, begin) = rust_ta_lib::wrapper::ultosc(&high,&low,&close,7,14,28);
for (index, value) in out.iter().enumerate() {
       println!("outs index {} = {}", begin + index as i32 + 1, value);
 }