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