Skip to content

Commit dae01a1

Browse files
committed
snapshot_by_key: update list
live_marketdata_snapshot_by_symbol: if a market_data field not found - return the number
1 parent c9d8133 commit dae01a1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

ibind/client/ibkr_client_mixins/marketdata_mixin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def live_marketdata_snapshot_by_symbol(self: 'IbkrClient', queries: StockQueries
7171

7272
for key, value in entry.items():
7373
if key not in snapshot_by_id:
74+
result[key] = value
7475
continue
7576

7677
result[snapshot_by_id[key]] = value

ibind/client/ibkr_definitions.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
'underlying_conid': '6457', # Underlying Conid. Use /trsrv/secdef to get more information about the security
1414
'market_data_availability': '6509', # Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. Second char defines: P = Snapshot, p = Consolidated. Third char defines: B = Book
1515
'conid_exchange': '7094', # Conid + Exchange
16+
'contract_description': '7219', # Contract Description
17+
'contract_description_alt': '7220', # Contract Description (alternative)
1618

17-
##Regulator snapshot
19+
# Regulator snapshot
1820
'ask_codes': '7057', # Returns the series of character codes for the Ask exchange.
19-
2021
'bid_codes': '7068', # Returns the series of character codes for the Bid exchange.
21-
2222
'last_exch_codes': '7058', # Returns the series of character codes for the Last exchange.
2323

2424
# Price and Volume
@@ -92,6 +92,7 @@
9292
'issue_date': '7715', # Issue Date
9393
'organization_type': '7704', # Organization Type
9494
'debt_class': '7705', # Debt Class
95+
'text': '58', # Text
9596

9697
# Options and Futures
9798
'opt_volume': '7089', # Opt. Volume - Option Volume
@@ -104,6 +105,7 @@
104105
'profit_probability': '7703', # Profit Probability - Customer implied probability of any gain.
105106
'last_yield': '7698', # Last Yield - Implied yield of the bond if it is purchased at the current last price. Last yield is calculated using the Last price on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
106107
'bid_yield': '7699', # Bid Yield - Implied yield of the bond if it is purchased at the current bid price. Bid yield is calculated using the Ask on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
108+
'ask_yield': '7720', # Ask Yield - Implied yield of the bond if it is purchased at the current offer. Ask yield is calculated using the Bid on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
107109
'futures_open_interest': '7697', # Futures Open Interest - Total number of outstanding futures contracts
108110
'shortable_shares': '7636', # Number of shares available for shorting.
109111
'shortable_fee_rate_percent': '7637', # Shortable Fee Rate % - The fee rate charged for shorting the security, expressed as an annualized percentage.
@@ -115,6 +117,8 @@
115117
'theta': '7310', # Theta - A measure of the rate of decline the value of an option due to the passage of time.
116118
'vega': '7311', # Vega - The amount that the price of an option changes compared to a 1% change in the volatility.
117119
'implied_vol_percent': '7633', # Implied Vol. % - The implied volatility for the specific strike of the option in percentage. To query the Option Implied Vol. % from the underlying refer to field 7283.
120+
'opt_volume_change_percent': '7607', # Opt. Volume Change % - Today's option volume as a percentage of the average option volume.
121+
'right': '201', # Right - Returns the right of the instrument, such as P for Put or C for Call.
118122

119123
# Wall Street Horizon
120124
'upcoming_event': '7683', # Upcoming Event - Shows the next major company event. Requires Wall Street Horizon subscription.
@@ -125,8 +129,14 @@
125129
'recent_analyst_meeting': '7688', # Recent Analyst Meeting - The date and time of the most recent analyst meeting. Requires Wall Street Horizon subscription.
126130
'recent_earnings': '7689', # Recent Earnings - The date and time of the most recent earnings/earning call event. Requires Wall Street Horizon subscription.
127131
'recent_misc_event': '7690', # Recent Misc Event - The date and time of the most recent shareholder meeting, presentation, or other event. Requires Wall Street Horizon subscription.
132+
'morningstar_rating': '7655', # Morningstar Rating - Displays Morningstar Rating provided value. Requires Morningstar subscription.
133+
134+
# Dividends
135+
'dividends': '7671', # Dividends - This value is the total of the expected dividend payments over the next twelve months per share.
136+
'dividends_ttm': '7672', # Dividends TTM - This value is the total of the expected dividend payments over the last twelve months per share.
128137

129138
# Miscellaneous
139+
'can_be_traded': '7184', # canBeTraded - If contract is a trade-able instrument. Returns 1(true) or 0(false).
130140
'shortable': '7644', # Shortable - Describes the level of difficulty with which the security can be sold short.
131141
'service_params': '6508', # Service Params.
132142
'market_data_marker': '6119', # Marker for market data delivery method (similar to request id)

0 commit comments

Comments
 (0)