From 2fbce189480522864d59ad2b08905c7048992ee7 Mon Sep 17 00:00:00 2001 From: Sik Yoon Date: Tue, 21 May 2024 12:06:00 +0900 Subject: [PATCH] Change term --- src/future/mod.rs | 4 ++-- src/future/table_mgmt.rs | 6 +++--- src/initialization.rs | 2 +- src/strategy_team/strategy_manager.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/future/mod.rs b/src/future/mod.rs index 521a896..f1dcff2 100644 --- a/src/future/mod.rs +++ b/src/future/mod.rs @@ -128,7 +128,7 @@ pub struct PositionCoinList { pub close_time: i64, pub used_usdt: Decimal, pub expected_get_usdt: f64, - pub expected_usdt_profit: f64, + pub pnl: f64, pub entry_price: Decimal, pub current_price: Decimal, pub base_qty_ordered: Decimal, @@ -151,7 +151,7 @@ impl PositionCoinList { close_time: 0, used_usdt: Decimal::new(0, 8), expected_get_usdt: 0.0, - expected_usdt_profit: 0.0, + pnl: 0.0, entry_price: Decimal::new(0, 8), current_price: Decimal::new(0, 8), base_qty_ordered: Decimal::new(0, 8), diff --git a/src/future/table_mgmt.rs b/src/future/table_mgmt.rs index 65a6e1e..2d5fe44 100644 --- a/src/future/table_mgmt.rs +++ b/src/future/table_mgmt.rs @@ -166,7 +166,7 @@ async fn update_repeat_task( let update_colums = vec![ "current_price", "expected_get_usdt", - "expected_usdt_profit", + "pnl", "pure_profit_percent", "minimum_profit_percent", "maximum_profit_percent", @@ -174,7 +174,7 @@ async fn update_repeat_task( let mut update_record_build: Vec = Vec::new(); let mut update_record: Vec> = Vec::new(); - // update current_price, expected__get_usdt, expected_usdt_profit, pure_profit_percent, minimum_profit_percent, maximum_profit_percent + // update current_price, expected__get_usdt, pnl, pure_profit_percent, minimum_profit_percent, maximum_profit_percent for element in buy_ordered_coin_vec { // build update values update_record_build.clear(); @@ -218,7 +218,7 @@ async fn update_repeat_task( update_record_build.push(element.id.to_string()); // id update_record_build.push(price.to_string()); // current_price update_record_build.push(decimal_add(unrealized_pnl, element.used_usdt).to_string()); //expected_get_usdt - update_record_build.push(unrealized_pnl.to_string()); // expected_usdt_profit + update_record_build.push(unrealized_pnl.to_string()); // pnl update_record_build.push(pure_profit_percent.to_string()); // pure_profit_percent if element.minimum_profit_percent > pure_profit_percent { diff --git a/src/initialization.rs b/src/initialization.rs index 56fae4f..062e612 100644 --- a/src/initialization.rs +++ b/src/initialization.rs @@ -1313,7 +1313,7 @@ async fn initialize_database() { ("close_time", "bigint", None), ("used_usdt", "decimal(16,8)", None), ("expected_get_usdt", "double", None), - ("expected_usdt_profit", "double", None), + ("pnl", "double", None), ("entry_price", "decimal(16,8)", None), ("current_price", "decimal(16,8)", None), ("base_qty_ordered", "decimal(16,8)", None), diff --git a/src/strategy_team/strategy_manager.rs b/src/strategy_team/strategy_manager.rs index f08292a..7764a6d 100644 --- a/src/strategy_team/strategy_manager.rs +++ b/src/strategy_team/strategy_manager.rs @@ -152,7 +152,7 @@ pub async fn insert_future_coins( "close_time", "used_usdt", "expected_get_usdt", - "expected_usdt_profit", + "pnl", "entry_price", "current_price", "base_qty_ordered", @@ -173,7 +173,7 @@ pub async fn insert_future_coins( filtered_data.closetime.to_string(), // close_time 0.0.to_string(), // used_usdt 0.0.to_string(), // expected_get_usdt - 0.0.to_string(), // expected_usdt_profit + 0.0.to_string(), // pnl 0.0.to_string(), // entry_price 0.0.to_string(), // current_price 0.0.to_string(), // base_qty_ordered