Function sma

Source
pub fn sma(
    period: u32,
    close_prices: &Vec<TA_Real>,
) -> (Vec<TA_Real>, TA_Integer)
Expand description

TA_SMA - Simple Moving Average

Input = double Output = double #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 (outReal, begin) = rust_ta_lib::wrapper::sma( 10,&inReal);
for (index, value) in outReal.iter().enumerate() {
       println!("outs index {} = {}", begin + index as i32 + 1, value);
 }