use serde::{Deserialize, Serialize}; use std::fs; use traquer::*; #[derive(Deserialize, Serialize, Debug)] struct SecStats { high: Vec, low: Vec, open: Vec, close: Vec, volume: Vec, } fn main() { let data = fs::read_to_string("./tests/rddt.input").expect("Unable to read file"); let stats: SecStats = serde_json::from_str(&data).expect("JSON does not have correct format."); //dbg!(trend::adx(&stats.high, &stats.low, &stats.close, 14, 14).collect::>()); //dbg!(momentum::tsi(&stats.close, 6, 10, 3).collect::>()); //dbg!( // volatility::heikin_ashi(&stats.open, &stats.high, &stats.low, &stats.close) // .collect::>() //); dbg!(volume::nvi(&stats.close, &stats.volume).collect::>()); //dbg!(smooth::hwma(&stats.close, None, None, None).collect::>()); }