Fix wrong calculation of target profit percent
This commit is contained in:
parent
a6831d7f3e
commit
df2a494506
|
|
@ -413,10 +413,10 @@ pub async fn list_up_for_sell(
|
||||||
lot_step_size.normalize().scale(),
|
lot_step_size.normalize().scale(),
|
||||||
RoundingStrategy::ToZero,
|
RoundingStrategy::ToZero,
|
||||||
);
|
);
|
||||||
let target_profit_percent = decimal_div(
|
let target_profit_percent = decimal_mul(decimal_div(
|
||||||
decimal_sub(element.target_price, element.buy_price),
|
decimal_sub(element.target_price, element.buy_price),
|
||||||
element.buy_price,
|
element.buy_price,
|
||||||
)
|
), dec!(100))
|
||||||
.to_f64()
|
.to_f64()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
if !element.current_price.is_zero() {
|
if !element.current_price.is_zero() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user