Skip to main content

Order entry

TradeScript Pro Charts provides three focused order-entry surfaces. They share one TradingControllerApi, but each accepts the market-data identity and order shape required by its instrument family.

Choose a ticket

SurfaceUse it forRequired inputsPreview behavior
Order ticketStocks, funds, forex, futures, and cryptoOne resolved symbol, quote or current price, and trading controllerOptional: none, background, or confirmation dialog
Option order ticketSingle-leg and multi-leg optionsResolved underlying, option contracts or manual legs, market data, and trading controllerRequired; Preview & Place previews and then places in one action
Prediction-market order ticketIndependently tradable event outcomesAt least two exact outcome symbols, one quote per outcome, and trading controllerRequired; Review and Place are separate actions

Do not use the standard ticket for option legs or prediction outcomes. Their contract identity, pricing, validation, and placement flows are different.

Prepare the shared authorities

Before mounting a ticket:

  1. Create one authenticated TradingControllerApi for the broker session.
  2. Resolve instruments through the same market-data authority used by the chart.
  3. Supply current prices or independently bound quotes; broker state is not a substitute for live market data.
  4. Implement the operations required by the chosen ticket. Every adapter needs getState and placeOrder; option and prediction tickets also require previewOrder.

Reuse the controller across the chart, ticket, and account surfaces. The controller owner disconnects and destroys the broker session; destroying a ticket mount destroys only that surface.

Mount without a framework

Every licensed SDK product exposes the same retained mount, update, and destroy lifecycle. The standard ticket's framework-neutral module is sdk.orderTicket; the specialized modules are sdk.optionOrderTicket and sdk.predictionMarketOrderTicket.

orderEntry.ts
import type {
MarketDataControllerApi,
PredictionMarketOrderTicketOutcome,
TradeScriptSdkProducts,
TradingControllerApi,
} from '@tradescript/pro/sdk';

declare const sdk: TradeScriptSdkProducts;
declare const marketData: MarketDataControllerApi;
declare const trading: TradingControllerApi;
declare const outcomes: readonly PredictionMarketOrderTicketOutcome[];

const symbol = await marketData.resolveSymbol('AAPL');

const orderTicket = sdk.orderTicket.mount({
mount: document.getElementById('order-ticket')!,
trading,
symbol: symbol.ticker,
symbolInfo: symbol,
currentPrice: 214.4,
});

const optionTicket = sdk.optionOrderTicket.mount({
mount: document.getElementById('option-order-ticket')!,
trading,
marketData,
underlying: symbol,
currentPrice: 214.4,
});

const predictionTicket = sdk.predictionMarketOrderTicket.mount({
mount: document.getElementById('prediction-order-ticket')!,
trading,
outcomes,
});

// Later, when the host removes these surfaces:
orderTicket.destroy();
optionTicket.destroy();
predictionTicket.destroy();

Mount with React

Pass sdk directly or use TradeScriptProvider from @tradescript/pro/react/provider. Without either authority, the React adapter throws at mount time. The provider does not create trading or market-data controllers. Pass the shared trading controller as controller to TradingOrderTicket and as trading to the specialized tickets; also pass marketData to OptionOrderTicket.

SurfaceReact component and exact importExplicit authorities
StandardTradingOrderTicket from @tradescript/pro/react/widgets/order-ticketcontroller, exact symbol
OptionsOptionOrderTicket from @tradescript/pro/react/widgets/option-order-tickettrading, marketData, underlying
Prediction marketsPredictionMarketOrderTicket from @tradescript/pro/react/widgets/prediction-market-order-tickettrading, outcomes

The individual guides contain complete React examples and the asset-specific contracts.

Keep mutation completion authoritative

All three tickets validate a typed draft before calling the controller. A successful placeOrder response is only an acknowledgement. Publish working orders, fills, positions, and rejections through the broker's canonical state or event stream; do not create durable client-side order records from a ticket callback.

Treat a timeout or transport failure as an unknown financial outcome. Reconcile authoritative broker state before allowing another placement attempt.

Next steps