|
@@ -141,12 +141,11 @@ class RiskCleanupManager:
|
|
|
symbol = position.get('symbol', '')
|
|
|
contracts = float(position.get('current_position_size', 0))
|
|
|
entry_price = float(position.get('entry_price', 0))
|
|
|
- mark_price = float(position.get('mark_price', 0))
|
|
|
- unrealized_pnl = float(position.get('unrealized_pnl', 0))
|
|
|
roe_percentage = float(position.get('roe_percentage', 0))
|
|
|
+ unrealized_pnl = float(position.get('unrealized_pnl', 0))
|
|
|
|
|
|
- if contracts == 0 or entry_price <= 0 or mark_price <= 0:
|
|
|
- logger.info(f"Skipping position {symbol}: contracts={contracts}, entry_price={entry_price}, mark_price={mark_price}")
|
|
|
+ if contracts == 0 or entry_price <= 0:
|
|
|
+ logger.info(f"Skipping position {symbol}: contracts={contracts}, entry_price={entry_price}")
|
|
|
continue
|
|
|
|
|
|
logger.info(f"[RiskMgmt] {symbol}: ROE={roe_percentage:+.2f}%, Threshold=-{Config.STOP_LOSS_PERCENTAGE}% (Trigger: {roe_percentage <= -Config.STOP_LOSS_PERCENTAGE})")
|
|
@@ -170,7 +169,6 @@ Token: {token}\\n
|
|
|
Lifecycle ID: {lifecycle_id_str}\\n
|
|
|
Position: {position_side} {abs(contracts):.6f}\\n
|
|
|
Entry Price: ${entry_price:.4f}\\n
|
|
|
-Current Price: ${mark_price:.4f}\\n
|
|
|
Unrealized P&L: ${unrealized_pnl:+.2f} ({roe_percentage:+.2f}% ROE)\\n
|
|
|
Safety Threshold: -{Config.STOP_LOSS_PERCENTAGE}% ROE\\n
|
|
|
Action: Executing emergency exit order..."""
|