Fix monitor board crash: avoid shadowing options_open_position_count helper.
Rename the imported counter function so aggregate_monitor_board_totals no longer overwrites it with an int accumulator. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -43,6 +43,26 @@ def test_aggregate_monitor_board_totals_sums_rows():
|
||||
assert out["float_pnl_u"] == 1.2
|
||||
|
||||
|
||||
def test_aggregate_monitor_board_totals_includes_options():
|
||||
rows = [
|
||||
{
|
||||
"capabilities": ["options"],
|
||||
"options": {
|
||||
"ok": True,
|
||||
"enabled": True,
|
||||
"positions": [{"inst_id": "X"}, {"inst_id": "Y"}],
|
||||
"upl_total_usdc": 1.5,
|
||||
},
|
||||
"agent": {"positions": [], "total_unrealized_pnl": 0},
|
||||
}
|
||||
]
|
||||
out = aggregate_monitor_board_totals(rows, trading_day="2026-07-04", reset_hour=8)
|
||||
assert out["options_open_position_count"] == 2
|
||||
assert out["open_position_count"] == 2
|
||||
assert out["options_float_pnl_u"] == 1.5
|
||||
assert out["float_pnl_u"] == 1.5
|
||||
|
||||
|
||||
def test_summarize_trades_win_loss_amounts():
|
||||
from lib.hub.hub_trades_lib import summarize_trades
|
||||
|
||||
|
||||
Reference in New Issue
Block a user