Chartbreaker
    Preparing search index...

    Interface PreparedInstrument

    interface PreparedInstrument {
        authorizeOrder?: (
            order: Order,
            confirmedRiskHint: boolean,
            authenticationMethodId?: string,
            signal?: AbortSignal_2,
        ) => Promise<AuthorizedOrder>;
        availableOrderIntents?: OrderIntentAvailability;
        buildDetailedOrderCostEstimationToken?: (order: Order) => string;
        clearingAccountNoOptions?: Options;
        estimateOrderCosts?: (
            order: Order,
            signal?: AbortSignal_2,
        ) => Promise<OrderCostEstimation>;
        exchanges: Exchange[];
        getQuote?: (order: Order, signal?: AbortSignal_2) => Promise<Quote>;
        instrument: Instrument;
        instrumentExplanation?: InstrumentExplanation;
        maySkipCostEstimation?: boolean;
        noExchangeDefault: boolean;
        performOrderRequiresCostCalculation?: boolean;
        pxOrderMaySetExpertDisclosure?: boolean;
        quoteOrderEstimationRequiresQuote?: boolean;
        riskClassInfo?: RiskClassInfo;
        sizeField: { defaultStartValue?: string; label: string; stepSize?: string };
        sizeMaxDecimalsBySizeUnit?: Record<string, number>;
        sizeUnit?: string;
        sizeUnitsByClearingAccountNo?: Record<
            string,
            Record<string, { label: string; unit: string }>,
        >;
        strikingHint?: string;
        tradingViaCryptoService?: boolean;
        createAvailableOrderIntentsObservable?(): Observable<
            OrderIntentAvailability,
        >;
        createJfdStopLossByPipDistanceObservable?(
            order: Order,
            stopLossPipDistance: string,
        ): Observable<string>;
        createJfdTakeProfitByPipDistanceObservable?(
            order: Order,
            takeProfitPipDistance: string,
        ): Observable<string>;
        createOrderCalculationObservable?(
            order: Order,
        ): Observable<CalculationResult>;
        createTicker?(brokerExchangeId: string): Promise<Ticker>;
        getSecurityQuotesMeta?(
            brokerExchangeId: string,
        ): Promise<{ currency: string; decimals: number; quoteSourceName: string }>;
        getSizeUnits?(forValues: SizeUnitDependencyValues): SizeUnitOption[];
        stopLossAllowed(forValues: StopLossDependencyValues): boolean;
        takeProfitAllowed(forValues: TakeProfitDependencyValues): boolean;
    }
    Index

    Properties

    authorizeOrder?: (
        order: Order,
        confirmedRiskHint: boolean,
        authenticationMethodId?: string,
        signal?: AbortSignal_2,
    ) => Promise<AuthorizedOrder>

    authorize an order (e.g. request a mobile TAN).

    availableOrderIntents?: OrderIntentAvailability

    order intents for the prepared instrument

    buildDetailedOrderCostEstimationToken?: (order: Order) => string

    If defined, a detailed cost estimation can be retrieved using the token generated by this function, using the getDetailedCostEstimationTable of the session.

    clearingAccountNoOptions?: Options

    If set, the user must select the clearing account to use. The order must have clearingAccountNo set in that case.

    use the more specific Exchange.clearingAccountNoOptions instead.

    estimateOrderCosts?: (
        order: Order,
        signal?: AbortSignal_2,
    ) => Promise<OrderCostEstimation>

    Estimate the order costs. If it is set, can be called

    • immediately when getQuote() has returned a quote
    • in parallel with authorizeOrder() for non-quote orderModels

    If maySkipCostEstimation is true and the user has decided to skip it, it should not be called.

    exchanges: Exchange[]

    All available exchanges with their order creation capabilities.

    getQuote?: (order: Order, signal?: AbortSignal_2) => Promise<Quote>

    Get an OTC quote.

    instrument: Instrument

    Matched instrument, as defined by the external instruments dependency.

    instrumentExplanation?: InstrumentExplanation

    If given, an info icon will be shown next to the instrument selection button.

    maySkipCostEstimation?: boolean
    noExchangeDefault: boolean

    If this is true, frontends are not allowed to set an exchange default. Users must select an exchange explicitly.

    performOrderRequiresCostCalculation?: boolean

    If true, it is not allowed to create the order (= call authorizedOrder.perform()) before presenting the costs to the user. This means, while the costs are loading, frontends should disable the perform order button.

    pxOrderMaySetExpertDisclosure?: boolean

    For PX: may set pxExpertDisclosure flag.

    quoteOrderEstimationRequiresQuote?: boolean

    If true, "calculate costs" is only available if a quote is ready to be accepted (i.e. it has been successfully requested using getQuote)

    riskClassInfo?: RiskClassInfo
    sizeField: { defaultStartValue?: string; label: string; stepSize?: string }

    Type Declaration

    • OptionaldefaultStartValue?: string

      Default value suggestion (if instrument is already in portfolio, may be the current units) for the size form field.

    • label: string

      The label for the size field.

    • OptionalstepSize?: string

      Suggestion for size field +/- button step size to use.

    sizeMaxDecimalsBySizeUnit?: Record<string, number>

    This may restrict the number of decimals that users should be allowed to provide for a sizeUnit. E.g., if this is { XXX: 2, EUR: 5 }, the UI should allow the user to enter 2 decimals for sizeUnit XXX and 5 decimals for sizeUnit EUR. If it is not set or the selected sizeUnit is not defined in the map, frontends should not restrict the number of decimals the user can enter.

    sizeUnit?: string

    The default size unit for the instrument. Note that getSizeUnits may reveal more options, if it is implemented for the broker.

    If is not though, this must be used (if set).

    sizeUnitsByClearingAccountNo?: Record<
        string,
        Record<string, { label: string; unit: string }>,
    >

    sizeunits per cash account and their label/unit e.g. { 123456789: { XXX: {label:'Stück', unit: 'Stück', EUR: {label: 'Nominalwert in EUR', unit: 'EUR' }}

    use getSizeUnits/sizeUnit instead.

    strikingHint?: string

    If set, a striking hint that is visible at all times in the order mask, informing about special attributes of the instrument must be displayed.

    tradingViaCryptoService?: boolean

    If true, trades for this security must be sent to the external crypto trading service. This must be indicated in the frontend as well (sending the request to the external service is handled inside of bg-trading).

    Methods

    • Only available for JFD: compute the StopLoss value by pip distance

      Parameters

      • order: Order

        the order to calculate the stop loss value for

      • stopLossPipDistance: string

      Returns Observable<string>

    • Only available for JFD: compute the TakeProfit value by pip distance

      Parameters

      • order: Order

        the order to calculate the stop loss value for

      • takeProfitPipDistance: string

      Returns Observable<string>

    • Parameters

      • brokerExchangeId: string

      Returns Promise<Ticker>

    • Parameters

      • brokerExchangeId: string

      Returns Promise<{ currency: string; decimals: number; quoteSourceName: string }>

    • Determine which sizeUnits and their labels are available for the given order values. Whenever one of the values clearingAccountNo, orderModel or direction is set, this function must be called by the UI to populate the list of selectable sizeUnits (and the according labels).

      Example return value:

      [
      { sizeUnit: 'XXX', sizeLabel: 'Stück', unitLabel: 'Stück' },
      { sizeUnit: 'EUR', sizeLabel: 'Nominalwert in EUR', unitLabel: 'EUR' },
      ]

      If this function is not implemented, it is possible that sizeUnit is always the same for this instrument. In this case the only possible value is defined in sizeUnit.

      Parameters

      Returns SizeUnitOption[]

    • Check whether it is possible to provide a stopLoss value for the given order parameter combination.

      Parameters

      Returns boolean

    • Check whether it is possible to provide a takeProfit value for the given order parameter combination.

      Parameters

      Returns boolean