From df2a4945060e80af8c71f5522ec13c91e10f44a3 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Thu, 2 May 2024 23:37:01 +0900 Subject: [PATCH] Fix wrong calculation of target profit percent --- 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 02804c9..c85e64d 100644 --- a/src/strategy_team/strategy_008.rs +++ b/src/strategy_team/strategy_008.rs @@ -413,10 +413,10 @@ pub async fn list_up_for_sell( lot_step_size.normalize().scale(), RoundingStrategy::ToZero, ); - let target_profit_percent = decimal_div( + let target_profit_percent = decimal_mul(decimal_div( decimal_sub(element.target_price, element.buy_price), element.buy_price, - ) + ), dec!(100)) .to_f64() .unwrap(); if !element.current_price.is_zero() {