From 2d3b34012371713b284f90fd75aed7c7f76bba11 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Sat, 12 Aug 2023 19:41:18 +0900 Subject: [PATCH] Delete unnecessary code --- src/main.rs | 297 +++++++--------------------------------------------- 1 file changed, 39 insertions(+), 258 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6469e25..7a46697 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,8 +75,6 @@ async fn main() -> Result<(), Box> { let tx_task7 = tx_task1.clone(); // for Task#7 let tx_task8 = tx_task1.clone(); // for Task#8 let tx_task9 = tx_task1.clone(); // for Task#9 - let tx_task10 = tx_task1.clone(); // for Task#10 - let tx_task11 = tx_task1.clone(); // for Task#11 let tx_task12 = tx_task1.clone(); // for Task#12 let tx_task13 = tx_task1.clone(); // for Task#13 let tx_task14 = tx_task1.clone(); // for Task#14 @@ -166,132 +164,6 @@ async fn main() -> Result<(), Box> { let mut rx2_rt_price_1mon_vec = rx_rt_price_1mon_vec.clone(); let mut rx3_rt_price_1mon_vec = rx_rt_price_1mon_vec.clone(); - // SMA data - let mut sma3_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> - let (tx_sma3_1m_data, mut rx_sma3_1m_data) = watch::channel(sma3_1m_data); - let mut rx2_sma3_1m_data = rx_sma3_1m_data.clone(); - let mut rx3_sma3_1m_data = rx_sma3_1m_data.clone(); - - let mut sma3_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma3_30m_data, mut rx_sma3_30m_data) = watch::channel(sma3_30m_data); - let mut rx2_sma3_30m_data = rx_sma3_30m_data.clone(); - - let mut sma3_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma3_1d_data, mut rx_sma3_1d_data) = watch::channel(sma3_1d_data); - let mut rx2_sma3_1d_data = rx_sma3_1d_data.clone(); - - let mut sma3_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma3_1w_data, mut rx_sma3_1w_data) = watch::channel(sma3_1w_data); - let mut rx2_sma3_1w_data = rx_sma3_1w_data.clone(); - - let mut sma3_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma3_1mon_data, mut rx_sma3_1mon_data) = watch::channel(sma3_1mon_data); - let mut rx2_sma3_1mon_data = rx_sma3_1mon_data.clone(); - - let mut sma10_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> - let (tx_sma10_1m_data, mut rx_sma10_1m_data) = watch::channel(sma10_1m_data); - let mut rx2_sma10_1m_data = rx_sma10_1m_data.clone(); - let mut rx3_sma10_1m_data = rx_sma10_1m_data.clone(); - - let mut sma10_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma10_30m_data, mut rx_sma10_30m_data) = watch::channel(sma10_30m_data); - let mut rx2_sma10_30m_data = rx_sma10_30m_data.clone(); - - let mut sma10_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma10_1d_data, mut rx_sma10_1d_data) = watch::channel(sma10_1d_data); - let mut rx2_sma10_1d_data = rx_sma10_1d_data.clone(); - - let mut sma10_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma10_1w_data, mut rx_sma10_1w_data) = watch::channel(sma10_1w_data); - let mut rx2_sma10_1w_data = rx_sma10_1w_data.clone(); - - let mut sma10_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma10_1mon_data, mut rx_sma10_1mon_data) = watch::channel(sma10_1mon_data); - let mut rx2_sma10_1mon_data = rx_sma10_1mon_data.clone(); - - let mut sma30_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> - let (tx_sma30_1m_data, mut rx_sma30_1m_data) = watch::channel(sma30_1m_data); - let mut rx2_sma30_1m_data = rx_sma30_1m_data.clone(); - - let mut sma30_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma30_30m_data, mut rx_sma30_30m_data) = watch::channel(sma30_30m_data); - let mut rx2_sma30_30m_data = rx_sma30_30m_data.clone(); - - let mut sma30_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma30_1d_data, mut rx_sma30_1d_data) = watch::channel(sma30_1d_data); - let mut rx2_sma30_1d_data = rx_sma30_1d_data.clone(); - - let mut sma30_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma30_1w_data, mut rx_sma30_1w_data) = watch::channel(sma30_1w_data); - let mut rx2_sma30_1w_data = rx_sma30_1w_data.clone(); - - let mut sma30_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_sma30_1mon_data, mut rx_sma30_1mon_data) = watch::channel(sma30_1mon_data); - let mut rx2_sma30_1mon_data = rx_sma30_1mon_data.clone(); - - // EMA data - let mut ema3_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> - let (tx_ema3_1m_data, mut rx_ema3_1m_data) = watch::channel(ema3_1m_data); - let mut rx2_ema3_1m_data = rx_ema3_1m_data.clone(); - let mut rx3_ema3_1m_data = rx_ema3_1m_data.clone(); - - let mut ema3_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema3_30m_data, mut rx_ema3_30m_data) = watch::channel(ema3_30m_data); - let mut rx2_ema3_30m_data = rx_ema3_30m_data.clone(); - - let mut ema3_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema3_1d_data, mut rx_ema3_1d_data) = watch::channel(ema3_1d_data); - let mut rx2_ema3_1d_data = rx_ema3_1d_data.clone(); - - let mut ema3_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema3_1w_data, mut rx_ema3_1w_data) = watch::channel(ema3_1w_data); - let mut rx2_ema3_1w_data = rx_ema3_1w_data.clone(); - - let mut ema3_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema3_1mon_data, mut rx_ema3_1mon_data) = watch::channel(ema3_1mon_data); - let mut rx2_ema3_1mon_data = rx_ema3_1mon_data.clone(); - - let mut ema10_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> - let (tx_ema10_1m_data, mut rx_ema10_1m_data) = watch::channel(ema10_1m_data); - let mut rx2_ema10_1m_data = rx_ema10_1m_data.clone(); - let mut rx3_ema10_1m_data = rx_ema10_1m_data.clone(); - - let mut ema10_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema10_30m_data, mut rx_ema10_30m_data) = watch::channel(ema10_30m_data); - let mut rx2_ema10_30m_data = rx_ema10_30m_data.clone(); - - let mut ema10_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema10_1d_data, mut rx_ema10_1d_data) = watch::channel(ema10_1d_data); - let mut rx2_ema10_1d_data = rx_ema10_1d_data.clone(); - - let mut ema10_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema10_1w_data, mut rx_ema10_1w_data) = watch::channel(ema10_1w_data); - let mut rx2_ema10_1w_data = rx_ema10_1w_data.clone(); - - let mut ema10_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema10_1mon_data, mut rx_ema10_1mon_data) = watch::channel(ema10_1mon_data); - let mut rx2_ema10_1mon_data = rx_ema10_1mon_data.clone(); - - let mut ema30_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> - let (tx_ema30_1m_data, mut rx_ema30_1m_data) = watch::channel(ema30_1m_data); - let mut rx2_ema30_1m_data = rx_ema30_1m_data.clone(); - - let mut ema30_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema30_30m_data, mut rx_ema30_30m_data) = watch::channel(ema30_30m_data); - let mut rx2_ema30_30m_data = rx_ema30_30m_data.clone(); - - let mut ema30_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema30_1d_data, mut rx_ema30_1d_data) = watch::channel(ema30_1d_data); - let mut rx2_ema30_1d_data = rx_ema30_1d_data.clone(); - - let mut ema30_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema30_1w_data, mut rx_ema30_1w_data) = watch::channel(ema30_1w_data); - let mut rx2_ema30_1w_data = rx_ema30_1w_data.clone(); - - let mut ema30_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_ema30_1mon_data, mut rx_ema30_1mon_data) = watch::channel(ema30_1mon_data); - let mut rx2_ema30_1mon_data = rx_ema30_1mon_data.clone(); - // TEMA data // let mut tema3_1m_data: Vec<(String, Vec<(f64, i64)>)> = Vec::new(); // Vec<(symbol, Vec<(price, closetime)>)> // let (tx_tema3_1m_data, mut rx_tema3_1m_data) = watch::channel(tema3_1m_data); @@ -326,92 +198,6 @@ async fn main() -> Result<(), Box> { // let mut tema30_1mon_data: Vec<(String, Vec<(f64, i64)>)> = Vec::new(); // let (tx_tema30_1mon_data, mut rx_tema30_1mon_data) = watch::channel(tema30_1mon_data); - // RSI data - let mut rsi3_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(rsi, closetime)>)> - let (tx_rsi3_1m_data, mut rx_rsi3_1m_data) = watch::channel(rsi3_1m_data); - let mut rsi3_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi3_30m_data, mut rx_rsi3_30m_data) = watch::channel(rsi3_30m_data); - let mut rsi3_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi3_1d_data, mut rx_rsi3_1d_data) = watch::channel(rsi3_1d_data); - let mut rsi3_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi3_1w_data, mut rx_rsi3_1w_data) = watch::channel(rsi3_1w_data); - let mut rsi3_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi3_1mon_data, mut rx_rsi3_1mon_data) = watch::channel(rsi3_1mon_data); - - let mut rsi10_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(rsi, closetime)>)> - let (tx_rsi10_1m_data, mut rx_rsi10_1m_data) = watch::channel(rsi10_1m_data); - let mut rsi10_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi10_30m_data, mut rx_rsi10_30m_data) = watch::channel(rsi10_30m_data); - let mut rsi10_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi10_1d_data, mut rx_rsi10_1d_data) = watch::channel(rsi10_1d_data); - let mut rsi10_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi10_1w_data, mut rx_rsi10_1w_data) = watch::channel(rsi10_1w_data); - let mut rsi10_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi10_1mon_data, mut rx_rsi10_1mon_data) = watch::channel(rsi10_1mon_data); - - let mut rsi30_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(rsi, closetime)>)> - let (tx_rsi30_1m_data, mut rx_rsi30_1m_data) = watch::channel(rsi30_1m_data); - let mut rsi30_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi30_30m_data, mut rx_rsi30_30m_data) = watch::channel(rsi30_30m_data); - let mut rsi30_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi30_1d_data, mut rx_rsi30_1d_data) = watch::channel(rsi30_1d_data); - let mut rsi30_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi30_1w_data, mut rx_rsi30_1w_data) = watch::channel(rsi30_1w_data); - let mut rsi30_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_rsi30_1mon_data, mut rx_rsi30_1mon_data) = watch::channel(rsi30_1mon_data); - - // Stochastic RSI10 K and D - let mut stoch_rsi3_1m_3_k_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(stoch rsi K, closetime)>)> - let (tx_stoch_rsi3_1m_3_k_data, mut rx_stoch_rsi3_1m_3_k_data) = - watch::channel(stoch_rsi3_1m_3_k_data); - let mut rx2_stoch_rsi3_1m_3_k_data = rx_stoch_rsi3_1m_3_k_data.clone(); - let mut stoch_rsi3_1m_3_d_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(stoch rsi D, closetime)>)> - let (tx_stoch_rsi3_1m_3_d_data, mut rx_stoch_rsi3_1m_3_d_data) = - watch::channel(stoch_rsi3_1m_3_d_data); - let mut rx2_stoch_rsi3_1m_3_d_data = rx_stoch_rsi3_1m_3_d_data.clone(); - let mut stoch_rsi30_1m_30_k_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(stoch rsi K, closetime)>)> - let (tx_stoch_rsi30_1m_30_k_data, mut rx_stoch_rsi30_1m_30_k_data) = - watch::channel(stoch_rsi30_1m_30_k_data); - let mut rx2_stoch_rsi30_1m_30_k_data = rx_stoch_rsi30_1m_30_k_data.clone(); - let mut stoch_rsi30_1m_30_d_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec<(stoch rsi D, closetime)>)> - let (tx_stoch_rsi30_1m_30_d_data, mut rx_stoch_rsi30_1m_30_d_data) = - watch::channel(stoch_rsi30_1m_30_d_data); - let mut rx2_stoch_rsi30_1m_30_d_data = rx_stoch_rsi30_1m_30_d_data.clone(); - - // BollingerBand data - let mut bb3_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec)> - let (tx_bb3_1m_data, mut rx_bb3_1m_data) = watch::channel(bb3_1m_data); - let mut bb3_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb3_30m_data, mut rx_bb3_30m_data) = watch::channel(bb3_30m_data); - let mut bb3_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb3_1d_data, mut rx_bb3_1d_data) = watch::channel(bb3_1d_data); - let mut bb3_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb3_1w_data, mut rx_bb3_1w_data) = watch::channel(bb3_1w_data); - let mut bb3_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb3_1mon_data, mut rx_bb3_1mon_data) = watch::channel(bb3_1mon_data); - - let mut bb10_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec)> - let (tx_bb10_1m_data, mut rx_bb10_1m_data) = watch::channel(bb10_1m_data); - let mut bb10_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb10_30m_data, mut rx_bb10_30m_data) = watch::channel(bb10_30m_data); - let mut bb10_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb10_1d_data, mut rx_bb10_1d_data) = watch::channel(bb10_1d_data); - let mut bb10_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb10_1w_data, mut rx_bb10_1w_data) = watch::channel(bb10_1w_data); - let mut bb10_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb10_1mon_data, mut rx_bb10_1mon_data) = watch::channel(bb10_1mon_data); - - let mut bb30_1m_data: Vec<(String, Vec)> = Vec::new(); // Vec<(symbol, Vec)> - let (tx_bb30_1m_data, mut rx_bb30_1m_data) = watch::channel(bb30_1m_data); - let mut bb30_30m_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb30_30m_data, mut rx_bb30_30m_data) = watch::channel(bb30_30m_data); - let mut bb30_1d_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb30_1d_data, mut rx_bb30_1d_data) = watch::channel(bb30_1d_data); - let mut bb30_1w_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb30_1w_data, mut rx_bb30_1w_data) = watch::channel(bb30_1w_data); - let mut bb30_1mon_data: Vec<(String, Vec)> = Vec::new(); - let (tx_bb30_1mon_data, mut rx_bb30_1mon_data) = watch::channel(bb30_1mon_data); - // Exchange Information data let mut exchange_info_data: Vec = Vec::new(); let (tx_exchange_info_data, mut rx_exchange_info_data) = watch::channel(exchange_info_data); @@ -459,107 +245,99 @@ async fn main() -> Result<(), Box> { match result { Some(1) => { - print!("\r1[■] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 10[ ] 11[ ] 12[ ] 13[ ] 14[ ] 15[ ] 16[ ] 17[ ] 18[ ] 19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[ ] 25[ ] 26[ ]"); + print!("\r1[■] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 12[ ] 13[ ] 14[ ]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19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[■] 25[ ] 26[ ]"); + print!("\r1[ ] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 12[ ] 13[ ] 14[ ] 15[ ] 16[ ] 17[ ] 18[ ] 19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[■] 25[ ] 26[ ]"); io::stdout().flush(); } Some(25) => { - print!("\r1[ ] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 10[ ] 11[ ] 12[ ] 13[ ] 14[ ] 15[ ] 16[ ] 17[ ] 18[ ] 19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[ ] 25[■] 26[ ]"); + print!("\r1[ ] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 12[ ] 13[ ] 14[ ] 15[ ] 16[ ] 17[ ] 18[ ] 19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[ ] 25[■] 26[ ]"); io::stdout().flush(); } Some(26) => { - print!("\r1[ ] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 10[ ] 11[ ] 12[ ] 13[ ] 14[ ] 15[ ] 16[ ] 17[ ] 18[ ] 19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[ ] 25[ ] 26[■]"); + print!("\r1[ ] 2[ ] 3[ ] 4[ ] 5[ ] 6[ ] 7[ ] 8[ ] 9[ ] 12[ ] 13[ ] 14[ ] 15[ ] 16[ ] 17[ ] 18[ ] 19[ ] 20[ ] 21[ ] 22[ ] 23[ ] 24[ ] 25[ ] 26[■]"); io::stdout().flush(); } Some(_) => {} @@ -830,10 +608,11 @@ async fn main() -> Result<(), Box> { match result { Ok(T) => { - tx_rt_price_1m_vec.send_modify(|vec| *vec = rt_price_1m_vec_write_temp); - tx_task10 - .send(10) - .expect("The mpsc channel has been closed."); + if tx_rt_price_1m_vec.is_closed() { + eprintln!("tx_rt_price_1m_vec has been closed!"); + } else { + tx_rt_price_1m_vec.send_modify(|vec| *vec = rt_price_1m_vec_write_temp); + } } Err(E) => {} } @@ -858,10 +637,11 @@ async fn main() -> Result<(), Box> { match result { Ok(T) => { - tx_rt_price_30m_vec.send_modify(|vec| *vec = rt_price_30m_vec_write_temp); - tx_task10 - .send(10) - .expect("The mpsc channel has been closed."); + if tx_rt_price_30m_vec.is_closed() { + eprintln!("tx_rt_price_30m_vec has been closed!"); + } else { + tx_rt_price_30m_vec.send_modify(|vec| *vec = rt_price_30m_vec_write_temp); + } } Err(E) => {} } @@ -887,10 +667,11 @@ async fn main() -> Result<(), Box> { match result { Ok(T) => { - tx_rt_price_1d_vec.send_modify(|vec| *vec = rt_price_1d_vec_write_temp); - tx_task10 - .send(10) - .expect("The mpsc channel has been closed."); + if tx_rt_price_1d_vec.is_closed() { + eprintln!("tx_rt_price_1d_vec has been closed!"); + } else { + tx_rt_price_1d_vec.send_modify(|vec| *vec = rt_price_1d_vec_write_temp); + } } Err(E) => {} }