Calculates profit/loss for a closed signal with slippage and fees.
For signals with partial closes:
Weights are calculated by ACTUAL DOLLAR VALUE of each partial relative to total invested.
This correctly handles DCA entries that occur before or after partial closes.
Partial effective price is computed from costBasisAtClose snapshot:
effectivePrice = costBasisAtClose / Σ(entry.cost/entry.price for entries[0..entryCountAtClose])
Fee structure:
Open fee: CC_PERCENT_FEE (charged once)
Close fee: CC_PERCENT_FEE × weight × (closeWithSlip / openWithSlip) per partial/remaining
Calculates profit/loss for a closed signal with slippage and fees.
For signals with partial closes:
Partial effective price is computed from costBasisAtClose snapshot: effectivePrice = costBasisAtClose / Σ(entry.cost/entry.price for entries[0..entryCountAtClose])
Fee structure: