rust #10
@ -391,7 +391,7 @@ impl Position {
|
||||
|
||||
(base_price, delta)
|
||||
} else {
|
||||
let base_price = self.base_price * (1.0 - fee_perc / 100.0);
|
||||
let base_price = self.base_price * (1.0 + fee_perc / 100.0);
|
||||
let delta = best_offer - base_price;
|
||||
|
||||
(base_price, delta)
|
||||
@ -399,8 +399,7 @@ impl Position {
|
||||
};
|
||||
|
||||
let profit_loss = delta * self.amount.abs();
|
||||
let profit_loss_percentage =
|
||||
((1.0 - (base_price + delta) / base_price) * 100.0).abs() * profit_loss.signum();
|
||||
let profit_loss_percentage = delta / base_price * 100.0;
|
||||
|
||||
self.pl = profit_loss;
|
||||
self.pl_perc = profit_loss_percentage;
|
||||
|
Loading…
Reference in New Issue
Block a user