From e4d19b7d481396597af24de5202218ba975847a5 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Thu, 28 Mar 2024 23:54:54 +0900 Subject: [PATCH] Limit buy price --- src/strategy_team/strategy_008.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy_team/strategy_008.rs b/src/strategy_team/strategy_008.rs index e4c7939..6a5a09b 100644 --- a/src/strategy_team/strategy_008.rs +++ b/src/strategy_team/strategy_008.rs @@ -131,7 +131,7 @@ pub async fn list_up_for_buy( } remove_keys(&mut filtered_data, keys_to_remove).await; - // limit buy price: 2 * abs(이전 5 개 중 최대값 제거 한 opclo 값 평균 - 현재 open 값) + 현재 open 값 > current_price + // limit buy price: 0.5 * abs(이전 5 개 중 최대값 제거 한 opclo 값 평균 - 현재 open 값) + 현재 open 값 > current_price let mut keys_to_remove: HashSet = HashSet::new(); let server_epoch = get_server_epoch().await; for (symbol, values) in &mut filtered_data { @@ -154,7 +154,7 @@ pub async fn list_up_for_buy( let current_price = rt_price_vec.last().unwrap().close_price; let difference = (mean - rt_price_vec.last().unwrap().open_price).abs(); - if current_price < rt_price_vec.last().unwrap().open_price + (2.0 * difference) { + if current_price < rt_price_vec.last().unwrap().open_price + (0.5 * difference) { } else { keys_to_remove.insert(symbol.clone()); }