Constructors

Methods

  • Parameters

    • event: string
    • cb: (payload: unknown) => void

    Returns () => void

  • Snap dragged order and bracket lines, and the price their modify events carry, to the instrument's ticks. Null, the default, passes the pointer's price through unrounded, as it always has. The host's own validation stays authoritative either way; this only stops a drag previewing a price the instrument cannot trade at. Instrument.applyTo and chart.setTickSchedule set it, so call this after either to override it.

    Parameters

    Returns void

  • Refresh a position's P&L pill in place, without recreating its line: the pill reads pnlText, then pnlPercent in brackets. Either one left out keeps what the pill showed. The host formats both, since only it knows the account's currency and how it rounds.

    Parameters

    • id: string
    • OptionalpnlText: string
    • OptionalpnlPercent: string

    Returns void

  • The form that also takes the P&L as a number, which nothing ever read: the pill shows pnlText and pnlPercent only.

    Parameters

    • id: string
    • unrealizedPnl: number
    • OptionalpnlText: string
    • OptionalpnlPercent: string

    Returns void

    Removed in 3.0.0. Leave the number out: updatePositionPnl(id, pnlText, pnlPercent) (since 2.6.0) sets the same pill.