Function wma

Source
pub fn wma(period: u32, close: &Vec<f64>) -> (Vec<f64>, TA_Integer)
Expand description

TA_WMA - Weighted Moving Average

ยงInput = double Output = double

optInTimePeriod:(From 2 to 100000) Number of period #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 (outs, begin) = rust_ta_lib::wrapper::wma(10,&close_prices);
for (index, value) in outs.iter().enumerate() {
       println!("outs index {} = {}", begin + index as i32 + 1, value);
 }