From 75f44320901e554b3dea2238fe36cb66e66a9486 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Sun, 26 May 2024 01:42:09 +0900 Subject: [PATCH] Update filtering --- src/strategy_team/future_strategy_long.rs | 8 ++++++-- src/strategy_team/future_strategy_short.rs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/strategy_team/future_strategy_long.rs b/src/strategy_team/future_strategy_long.rs index efeca7f..121160c 100644 --- a/src/strategy_team/future_strategy_long.rs +++ b/src/strategy_team/future_strategy_long.rs @@ -267,12 +267,13 @@ pub async fn list_up_for_sell(all_data: &AllData) -> Result<(), Box 10 && sma3_open_vec.len() > 10 { if sma3_open_vec.last().unwrap().close_time == sma3_close_vec.last().unwrap().close_time && sma3_open_vec.last().unwrap().close_time > server_epoch && sma3_open_vec.last().unwrap().sma_value > sma3_close_vec.last().unwrap().sma_value { - is_sell = true; + over_turned = true; } } } @@ -290,7 +291,10 @@ pub async fn list_up_for_sell(all_data: &AllData) -> Result<(), Box 1_800_000 { + is_sell = true; + } + if is_sell == true { limit_order_close( &element, diff --git a/src/strategy_team/future_strategy_short.rs b/src/strategy_team/future_strategy_short.rs index 95d8e98..293cb43 100644 --- a/src/strategy_team/future_strategy_short.rs +++ b/src/strategy_team/future_strategy_short.rs @@ -267,12 +267,13 @@ pub async fn list_up_for_sell(all_data: &AllData) -> Result<(), Box 10 && sma3_open_vec.len() > 10 { if sma3_open_vec.last().unwrap().close_time == sma3_close_vec.last().unwrap().close_time && sma3_open_vec.last().unwrap().close_time > server_epoch && sma3_open_vec.last().unwrap().sma_value < sma3_close_vec.last().unwrap().sma_value { - is_sell = true; + over_turned = true; } } } @@ -290,7 +291,10 @@ pub async fn list_up_for_sell(all_data: &AllData) -> Result<(), Box 1_800_000 { + is_sell = true; + } + if is_sell == true { limit_order_close( &element,