Added better pnl
This commit is contained in:
1 parent
5add27a107
commit
96cf8dcfac
2 files changed
+3
-3
No files matched your search
@@ -87,7 +87,7 @@ Sniper::MaybeTarget Sniper::pick() {
|
||||
LOG(Spartan, Info, "Top opportunities");
|
||||
for (auto it = valuation.rbegin(); it != valuation.rend(); it++) {
|
||||
LOG(Spartan, Info, " {}", it->value);
|
||||
if (max_print-- == 0 || it->value<0)
|
||||
if (max_print-- == 0 || it->value<=0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ double AlgoAgent::pandl() const {
|
||||
auto flow = mkt_to_cash_flow(f.side);
|
||||
|
||||
this_pos.cash += flow * cash;
|
||||
this_pos.contracts += -flow * cash;
|
||||
this_pos.contracts += -flow * f.last_fills.value();
|
||||
}
|
||||
|
||||
// Liquidate remainder contracts
|
||||
@@ -72,7 +72,7 @@ double AlgoAgent::pandl() const {
|
||||
auto cash = mkt.price.price();
|
||||
auto flow = mkt_to_cash_flow(mkt_action);
|
||||
this_pos.cash += flow * cash;
|
||||
this_pos.contracts += -flow * cash;
|
||||
this_pos.contracts += -flow * this_pos.contracts;
|
||||
}
|
||||
|
||||
// Convert to human terms, sum across all contracts
|
||||
|
||||
Reference in new issue
Block a user