|
@@ -126,7 +126,9 @@ class SimplePositionTracker:
|
|
|
lifecycle_id=lifecycle_id,
|
|
|
entry_price=entry_price,
|
|
|
entry_amount=size,
|
|
|
- exchange_fill_id=f"position_detected_{timestamp.isoformat()}"
|
|
|
+ exchange_fill_id=f"position_detected_{timestamp.isoformat()}",
|
|
|
+ unrealized_pnl=exchange_pos.get('unrealizedPnl'),
|
|
|
+ unrealized_pnl_percentage=exchange_pos.get('returnOnEquity', 0.0) * 100 # Convert to percentage
|
|
|
)
|
|
|
|
|
|
if success:
|
|
@@ -242,7 +244,10 @@ class SimplePositionTracker:
|
|
|
|
|
|
# Update position size using existing manager
|
|
|
success = stats.trade_manager.update_trade_market_data(
|
|
|
- lifecycle_id, current_position_size=exchange_size
|
|
|
+ lifecycle_id,
|
|
|
+ current_position_size=exchange_size,
|
|
|
+ unrealized_pnl=exchange_pos.get('unrealizedPnl'),
|
|
|
+ unrealized_pnl_percentage=exchange_pos.get('returnOnEquity', 0.0) * 100 # Convert to percentage
|
|
|
)
|
|
|
|
|
|
if success:
|