Order Example

View as MarkdownOpen in Claude

Reviewing the same material as our [Contract Example](/tws-api/doc/event-trading/contract-definition-discovery/forecast-ex-contract-example), we have all the tools needed to submit our order with some additional context available in the Order Ticket, featured on the right.

We are already aware that:

  • ForecastEx contracts are always “BUY” orders.
  • Event Contracts only support “LMT” as the Order Type.

This leaves us to decide the quantity, limit price, and time-in-force values.

We can set our limit price based on the values shown in the Order Ticket, or base the value on the Bid and Ask Price from our [Requested Market Data](/tws-api/doc/event-trading/market-data).

Displays an example of an order ticket being filled out for a Forecast Contract.

Given the information above, we are able to create a full order ticket.

Action: “BUY”

TotalQuantity: 1000

OrderType: “LMT”

LmtPrice: 0.57

Tif: “DAY”

1order = Order()
2order.action = "BUY"
3order.orderType = "LMT"
4order.totalQuantity = 1000
5order.lmtPrice = 0.57