get_position_greeks
Retrieve Interactive Brokers' model greeks for every option position, including delta, gamma, vega, theta, and contract details. Provides forward price, multiplier, settlement date, and missing data reasons.
Instructions
IB's model greeks for every option position — its numbers, not ones implied locally.
Returns per position: conid, symbol, secType, right, strike, lastTradeDate, settlementDate, daysToExpiry, position, multiplier, undPrice, impliedVol, delta, gamma, vega, theta, optPrice and pvDividend.
Things to know about the values:
undPrice is the forward IB used, not the index spot. For a futures option that is the future's price, which differs from the cash index by the basis; any repricing has to start from it.
multiplier comes from the contract. ES is 50 and MES is 5, and the difference is a factor of ten in every exposure figure.
settlementDate, not lastTradeDate, is the expiry. The quarterly ES options settle AM and stop trading the afternoon before, so TWS shows 17 December for something that expires on the 18th, while a weekly settling the same morning shows the 18th. Both are returned; pair positions on settlementDate.
Missing greeks are listed, not dropped. A contract IB never published model greeks for appears under
missingwith the reason. The usual causes are no market data subscription for that instrument, or a strike too illiquid for IB to imply a volatility. Note that delayed data does carry model greeks, so a missing row is rarely explained by the market data type alone.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No | Restrict to options on this underlying root, e.g. 'ES'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||