@qtsurfer/sdk
    Preparing search index...

    Type Alias LivePaperInstrument

    One instrument's part of a shared paper account.

    type LivePaperInstrument = {
        contributionPct?: number;
        instrument: string;
        kpi?: LivePaperKpi;
        losses: number;
        openPosition?: {
            base: number;
            cost: number;
            markedAtMs?: number;
            markPrice?: number;
            unrealisedPnl?: number;
        };
        realisedPnl: number;
        totalPnl?: number;
        trades: number;
        unrealisedPnl?: number;
        wins: number;
    }
    Index
    contributionPct?: number

    realisedPnl as a percent of the account's initialFunding (0-100 scale), so the contributions of the instruments add up to the account's realised return.

    instrument: string
    kpi?: LivePaperKpi

    The KPIs of this instrument's closed trades alone, with the account's initialFunding as the capital (so pnlTotalPercent equals contributionPct). Absent until its first closed trade.

    losses: number

    The other closed trades; a trade with a PnL of exactly zero is a loss.

    openPosition?: {
        base: number;
        cost: number;
        markedAtMs?: number;
        markPrice?: number;
        unrealisedPnl?: number;
    }

    What it holds now. Absent when it holds nothing.

    Type Declaration

    • base: number

      Amount held, in the base asset.

    • cost: number

      What it cost, in the account's currency.

    • OptionalmarkedAtMs?: number

      Market time (epoch ms) of that mark.

    • OptionalmarkPrice?: number

      The price it was valued at in the last mark. Present, with markedAtMs and unrealisedPnl, only when that mark is of the position as it stands now.

    • OptionalunrealisedPnl?: number

      base times markPrice, minus cost, in the account's currency.

    realisedPnl: number

    Sum of the PnL of its closed trades, in the account's currency.

    totalPnl?: number

    realisedPnl plus unrealisedPnl. Absent when unrealisedPnl is.

    trades: number

    Its closed trades.

    unrealisedPnl?: number

    What its open position is worth over its cost as of the last mark; 0 when it holds nothing. Absent while its position has no current mark (see openPosition).

    wins: number

    Closed trades with a PnL above zero.