Chartbreaker
    Preparing search index...

    Type Alias PortfolioValueHistoryRealizedTrade

    One completed trade whose profit/loss has been booked on a given day - the detail behind that day's realized profit/loss. Trades are matched FIFO, exactly like the trades of the trade tracker.

    type PortfolioValueHistoryRealizedTrade = {
        closeDateString: string;
        fees?: NumericString;
        feesCurrency?: string;
        feesFxRate?: NumericString;
        fxRate?: NumericString;
        instrument?: Instrument;
        instrumentId?: InstrumentId;
        isin?: string;
        name?: string;
        profitLossAbs: NumericString;
        profitLossCurrency?: string;
        realizedPnl: Amount;
        realizedPnlAfterFees?: Amount;
        size: NumericString;
    }
    Index
    closeDateString: string

    The day of the closing execution, YYYY-MM-DD. This equals the day the trade is booked on, except for closings on a weekend which are booked on the following weekday (the history only holds weekdays).

    The total fees of this trade, quoted in feesCurrency: the fee of the closing execution plus the matched buys' share of theirs. Taxes are not included.

    This is missing unless every execution taking part in the trade reported a fee, all in the same currency: a partial total would understate every loss and overstate every win by the unknown amount.

    feesCurrency?: string

    The currency fees is quoted in (ISO). Missing if fees is missing.

    feesFxRate?: NumericString

    The multiplier that has been applied to convert feesCurrency into the currency of realizedPnlAfterFees. Missing if no conversion was needed or if no fees are known.

    The fees are converted separately from the profit/loss, since a broker may bill them in the portfolio currency while the instrument is quoted in another one.

    fxRate?: NumericString

    The multiplier that has been applied to convert profitLossCurrency into the currency of realizedPnl. Missing if no conversion was needed.

    instrument?: Instrument

    The stock3 instrument the ISIN has been mapped to, as the positions and orders of this library carry it. Missing if the ISIN could not be mapped (or if the broker reported none) - a client should then fall back to name / isin.

    instrumentId?: InstrumentId

    The id of instrument, for clients that only need to link the row.

    isin?: string

    The ISIN of the closed position. Missing if the broker reported none.

    name?: string

    The security name as the broker reported it. Missing if unknown.

    profitLossAbs: NumericString

    The profit/loss of this trade before fees and taxes, quoted in profitLossCurrency.

    profitLossCurrency?: string

    The currency profitLossAbs is quoted in (ISO) - the quote currency the matched executions share. This is missing if the broker has stated none or if the matched buys and the sell are quoted in mixed currencies; the amount is then not converted and the position is named in the warnings.

    realizedPnl: Amount

    This trade's contribution to the day's realizedPnl.

    realizedPnlAfterFees?: Amount

    This trade's contribution to the day's realizedPnlAfterFees, i.e. realizedPnl minus the converted fees. Missing if fees is missing: an unknown fee makes the net result unknown instead of equal to the gross one.

    The quantity that has been closed.