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
| Surface | Use it for | Required inputs | Preview behavior |
|---|---|---|---|
| Order ticket | Stocks, funds, forex, futures, and crypto | One resolved symbol, quote or current price, and trading controller | Optional: none, background, or confirmation dialog |
| Option order ticket | Single-leg and multi-leg options | Resolved underlying, option contracts or manual legs, market data, and trading controller | Required; Preview & Place previews and then places in one action |
| Prediction-market order ticket | Independently tradable event outcomes | At least two exact outcome symbols, one quote per outcome, and trading controller | Required; 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:
- Create one authenticated
TradingControllerApifor the broker session. - Resolve instruments through the same market-data authority used by the chart.
- Supply current prices or independently bound quotes; broker state is not a substitute for live market data.
- Implement the operations required by the chosen ticket. Every adapter needs
getStateandplaceOrder; option and prediction tickets also requirepreviewOrder.
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.
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.
| Surface | React component and exact import | Explicit authorities |
|---|---|---|
| Standard | TradingOrderTicket from @tradescript/pro/react/widgets/order-ticket | controller, exact symbol |
| Options | OptionOrderTicket from @tradescript/pro/react/widgets/option-order-ticket | trading, marketData, underlying |
| Prediction markets | PredictionMarketOrderTicket from @tradescript/pro/react/widgets/prediction-market-order-ticket | trading, 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
- Order ticket — mount standard order entry and configure preview, modification, and attached exits.
- Option order ticket — compose exact option legs and broker-preview the strategy.
- Prediction-market order ticket — preserve exact outcome identity through review and placement.
- Broker integration — implement the state, rules, and operations consumed by these surfaces.