rust #10

Merged
peperunas merged 127 commits from rust into master 2021-02-18 09:42:16 +00:00
Showing only changes of commit 3a38c20f56 - Show all commits

View File

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