Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def _create_trades(
exit_ts=exit_ts,
trade_ts=timestamp_ms,
holding_ms=(exit_ts - entry_ts_prev) if entry_ts_prev else None,
unrealized_pnl=0.0,
realized_pnl=realized_pnl,
realized_pnl_pct=realized_pnl_pct,
# For a full close, reflect the leverage of the closed position, not the closing instruction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def apply_trades(
else:
# Derivatives: Cash (Wallet Balance) only changes by Realized PnL and Fees
# Notional is not deducted from cash.
self._view.account_balance -= fee
# self._view.account_balance -= fee
self._view.account_balance += realized_delta

total_realized += realized_delta
Expand Down