Ticker(contract=Option(conId=584786601, symbol='GOOGL', lastTradeDateOrContractMonth='20250117', strike=195.0, right='C', multiplier='100', exchange='SMART', currency='USD', localSymbol='GOOGL 250117C00195000', tradingClass='GOOGL'))
-
Volume 1385.0
callOpenInterest nan
putOpenInterest nan
impliedVolatility nan
что означает отсутствие открытого интереса. Используя IBKR TWS API, я могу получить открытый интерес, но путь к нему немного менее удобен для пользователя
Error. Id: -1, Code: 2104, Msg: Market data farm connection is OK:usfarm.nj
Error. Id: -1, Code: 2104, Msg: Market data farm connection is OK:usopt
Error. Id: -1, Code: 2104, Msg: Market data farm connection is OK:usfarm
Error. Id: -1, Code: 2107, Msg: HMDS data farm connection is inactive but should be available upon demand.ushmds
Error. Id: -1, Code: 2158, Msg: Sec-def data farm connection is OK:secdefnj
Not the expected tick type
Not the expected tick type
Not the expected tick type
Not the expected tick type
Not the expected tick type
Not the expected tick type
Not the expected tick type
TickSize. TickerId: 1 TickType: 27 Size: 21890
Not the expected tick type
Option Call Open Interest Size: 21890
Использует ли кто-нибудь ib_async для получения опции открытого интереса, и если да, не могли бы вы поделиться способом запроса этих данных?
Я пытаюсь получить открытый интерес к опциону с помощью ib_async, но он вообще не показывает открытый интерес. Код, который я использую ib_async: [code]from ib_async import *
ib.disconnect() [/code] вывод этого кода [code]Ticker(contract=Option(conId=584786601, symbol='GOOGL', lastTradeDateOrContractMonth='20250117', strike=195.0, right='C', multiplier='100', exchange='SMART', currency='USD', localSymbol='GOOGL 250117C00195000', tradingClass='GOOGL')) - Volume 1385.0 callOpenInterest nan putOpenInterest nan impliedVolatility nan [/code] что означает отсутствие открытого интереса. Используя IBKR TWS API, я могу получить открытый интерес, но путь к нему немного менее удобен для пользователя [code]from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract from ibapi.ticktype import TickTypeEnum import threading import time
class IBApp(EWrapper, EClient): def __init__(self): EClient.__init__(self, self) self.call_open_interest = None self.reqId = 1 self.oi_received = False # Flag to track if tick 27 was received
time.sleep(5) # Wait for a reasonable time for data
if app.oi_received: #check flag print(f"Option Call Open Interest Size: {app.call_open_interest}") else: print("Did not receive Option Call Open Interest data within the timeout.")
app.disconnect() [/code] Вывод этого кода: [code]Error. Id: -1, Code: 2104, Msg: Market data farm connection is OK:usfarm.nj Error. Id: -1, Code: 2104, Msg: Market data farm connection is OK:usopt Error. Id: -1, Code: 2104, Msg: Market data farm connection is OK:usfarm Error. Id: -1, Code: 2107, Msg: HMDS data farm connection is inactive but should be available upon demand.ushmds Error. Id: -1, Code: 2158, Msg: Sec-def data farm connection is OK:secdefnj Not the expected tick type Not the expected tick type Not the expected tick type Not the expected tick type Not the expected tick type Not the expected tick type Not the expected tick type TickSize. TickerId: 1 TickType: 27 Size: 21890 Not the expected tick type Option Call Open Interest Size: 21890 [/code] Использует ли кто-нибудь ib_async для получения опции открытого интереса, и если да, не могли бы вы поделиться способом запроса этих данных?