Change term

This commit is contained in:
Sik Yoon 2024-05-21 12:06:00 +09:00
parent 2d19927048
commit 2fbce18948
4 changed files with 8 additions and 8 deletions

View File

@ -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),

View File

@ -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<String> = Vec::new();
let mut update_record: Vec<Vec<String>> = 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 {

View File

@ -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),

View File

@ -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