OpenAPI supports trading industry standard and custom option strategies, such as Straddles, Condor and Butterfly strategies. These are orders are a form of basket orders, where one order is place to open multiple positions simultaneously. Each order is referred to as a "leg", and to maintain the desired risk and exposure the exchange guarantees symmetrical filling of all legs.
Currently the pre-defined strategies are:
BackRatio - Consists of two options, of same type and expiry, but with different amounts and strike prices.
Butterfly - Non directional strategy that combines legs of same expiry, but with varying amounts and strike prices.
CalendarSpread - A calendar spread is a long-short position is two calls or two puts. Both options have the same strike, but they have different expiration.
Condor - A condor strategy leverages four options with same expiry. A buy and a sell in the money, and a buy and a sell out of the money. Can also be characterized as two call spreads.
Diagonal - A diagonal spread is two options of the same type, one buy and one sell, but with different expiry times and different strike prices. Essentially a combination of a Vertical and Calendar spread.
IronButterfly - Two overlapping vertical spreads. One of the verticals is on the call side and one is on the put side.
IronCondor - A combined put and call spread with same expiration but varying different strikes.
RiskReversal - One leg is an out-of-the-money put, the other leg is an out-of-the-money call.
Straddle - A call and a put with the same underling strike price and maturity expiration date
Strangle - A call and put with different strike prices but with the same expiry.
Vertical - A vertical spread has two legs. One is buy and one is sell with same expiration date, but with different strike prices.
All other combination of individual legs are considered user-defined "custom" strategies.
Only option instruments are accepted as legs, so strategies that combine AssetTypes, such as Covered Calls and Married Puts are not supported yet.
Multi-leg orders are only supported on the trade/v2/orders endpoint.
Build a new option strategy
To simplify the process of building a pre-defined strategy with the nearest strike price and expiry date, simply submit the AccountKey, OptionRootId and strategy type to the /multileg/defaults/ endpoint.This is typically used to populate defaults in a trade module when a strategy is selected.
A response will be a list object containing up to 4 legs. StrategyName, Strike, CallPut and Expiry are added for readability purposes, a these fields are implicit to the selected instrument. In the below example. UIC 1483298 denotes the specific Call option in this chain that expires at October 25 and has a strike price of 245.
Price a option strategy
When a list of strategy options (legs) has been selected, a price for the whole strategy can be requested as a single request or as a continuous subscription. Typically this price may act as a basis for a Bid/Ask on a limit order.
To start a subscription to a price, simply use the /subscription endpoint as with other AssetTypes and enter the legs in the arguments.
The response will including prices for each individual leg as well as an overall price for the strategy:
Place an order for a option strategy
To place or precheck an options strategy order, use the dedicated endpoints. When placing an order you will need to provide the desired AccountKey and the OrderType on the strategy as well as ToOpenClose on each leg.
- AccountKey - Unique key identifying the account to place the order on.
- OrderDuration - How long the order is to remain in the market. Only DayOrder is currently supported.
- OrderPrice - Total desired limit price for all the legs with given amounts.
- OrderType - Type of order. Currently only Limit is supported.
- TraderId - Required by some platforms to indicate userid of who placed the order.
- ManualOrder - Required by some platforms to indicate if order is placed automatically or manually.
- Legs - List of orders in the batch that are to be filled symmetrically. (see below)
Each leg(order) consists of:
For a description of these fields, please see the parent Order Placement document.
Since orders are symmetrically filled, the amounts on each leg must be wholly divisible with one another.
If doing a precheck, the response will include the familiar precheck properties:
When placing an order, the resulting orderIds will be returned, one for each leg and a 'master' multi-leg orderid.
Orders and Positions
Once an order is placed, they will be available in the portfolio/orders service. Each leg will be a separate order and all orders in same strategy will be returned with a new property MultiLegOrderDetails. This structure contains relevant common properties for the strategy. MultilegOrderId can be used to group the orders.
These tools are only for order placement, so once filled, the resulting positions loose their relation are grouped into NetPositions by instrument (uic). In other words, resulting positions are unrelated and must be closed by placing an opposite "ToClose" strategy, or by individually closing each position.
Change an order for a option strategy
Due to the nature of the symmetrical filling, only a limited number of properties may be modified on an existing open multi-leg order. The Price is the total price you are willing to accept/pay for the strategy. The Amount will be symmetrically multiplied onto the leg amounts. If each leg consists of 10 lots and Amount of the overall strategy is changed to 2, then each leg amount will be updated to 20 lots.
Cancel an order for a option strategy
To cancel an open order, use the DELETE end point.