remove pnl rows from which there is no net pos or day pos

This commit is contained in:
Jake Norbut committed 2019-03-28 13:52:29 -05:00
1 parent 95939a5534
commit 95e96a6afc
1 file changed
+4
@@ -42,6 +42,10 @@ namespace mbts.spark {
if (p != null) {
PnLCalculator calc = new PnLCalculator(p.state.Values, _selected_pnl_calc_type.Value);
var summary_position_rows = calc.get_summary_position();
// remove rows for which there is no net pos or no day pos
summary_position_rows = summary_position_rows.Where(r =>
!(r.start_net_position == 0 && r.day_long_quantity == 0 && r.day_short_quantity == 0)
);
_pnl_data.sync_with(summary_position_rows);
_last_pnl_update_time = DateTime.Now;
}