diff --git a/src/strategy_team/strategy_008.rs b/src/strategy_team/strategy_008.rs index 6a5a09b..be1b49b 100644 --- a/src/strategy_team/strategy_008.rs +++ b/src/strategy_team/strategy_008.rs @@ -20,13 +20,13 @@ pub async fn list_up_for_buy( filtered_data.insert(symbol.clone(), FilteredDataValue::new()); } - // current Tema(5) > current Tema(10) + // current Tema(3) > current Tema(10) let mut keys_to_remove: HashSet = HashSet::new(); - let tema_5 = tema(5, &alldata.rt_price_1d_vec, &filtered_data).await?; + let tema_3 = tema(3, &alldata.rt_price_1d_vec, &filtered_data).await?; let tema_10 = tema(10, &alldata.rt_price_1d_vec, &filtered_data).await?; let server_epoch = get_server_epoch().await; for (symbol, values) in &mut filtered_data { - if let (Some(tema5_vec), Some(tema10_vec)) = (tema_5.get(symbol), tema_10.get(symbol)) { + if let (Some(tema5_vec), Some(tema10_vec)) = (tema_3.get(symbol), tema_10.get(symbol)) { if tema5_vec.len() > 2 && tema10_vec.len() > 2 && tema5_vec.last().unwrap().close_time == tema10_vec.last().unwrap().close_time && tema5_vec.last().unwrap().close_time > server_epoch && @@ -215,11 +215,19 @@ pub async fn list_up_for_sell( let lot_step_size = exchange_info.stepsize; let quote_commission_precision = exchange_info.quote_commission_precision; + + // TODO: BNB 코인이 있으면 let base_qty_to_be_ordered = element.base_qty_ordered.round_dp_with_strategy( lot_step_size.normalize().scale(), RoundingStrategy::ToZero, ); + // TODO: BNB 코인이 없으면 + // let base_qty_to_be_ordered = + // element.base_qty_fee_adjusted.round_dp_with_strategy( + // lot_step_size.normalize().scale(), + // RoundingStrategy::ToZero, + // ); let target_profit_percent = decimal_div(decimal_sub(element.target_price, element.buy_price), element.buy_price).to_f64().unwrap(); if (element.is_long == 0 || element.is_long == 1) && !element.current_price.is_zero()