Add hub TP profit field, 2-decimal options PnL, and exchange mark price display.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1989,6 +1989,7 @@ _ORDER_PRICE_MERGE_KEYS = (
|
||||
"display_rr_ratio",
|
||||
"latest_risk_amount",
|
||||
"contracts",
|
||||
"reward_at_tp_usdt",
|
||||
"exchange_initial_margin",
|
||||
"plan_margin",
|
||||
"time_close_enabled",
|
||||
@@ -2120,6 +2121,17 @@ def _merge_flask_position_breakeven(agent_row: dict, snap: dict | None, hub_mon:
|
||||
break
|
||||
if isinstance(matched, dict):
|
||||
_apply_order_price_op_fields(p, matched)
|
||||
disp = matched.get("exchange_mark_price_display")
|
||||
if disp is not None and str(disp).strip() not in ("", "-"):
|
||||
p["mark_price_fmt"] = str(disp)
|
||||
mp = matched.get("exchange_mark_price")
|
||||
if mp is not None:
|
||||
try:
|
||||
mpf = float(mp)
|
||||
if mpf > 0:
|
||||
p["mark_price"] = mpf
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
|
||||
def _agent_position_has_mark(p: dict) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user