Closed ZeniT21 closed 1 year ago
Будьте добры прикрепить код воспроизводящий проблему, гляну.
headers = {
"Authorization": "Bearer "+secret_key,
}
payload = {
"instrumentStatus": "INSTRUMENT_STATUS_UNSPECIFIED",
"classCode": "string",
"id": "string"
}
url = 'https://invest-public-api.tinkoff.ru/rest/tinkoff.public.invest.api.contract.v1.InstrumentsService/Shares'
response = requests.post(url, json = payload, headers=headers)
response = json.loads(response.text)
Ti_Instruments = []
with Client(secret_key) as client:
market_data_stream: MarketDataStreamManager = client.create_market_data_stream()
i = 0
for ticker in response['instruments']:
i += 1
if i % 99 == 0:
sleep(60)
market_data_stream.order_book.subscribe(
[
OrderBookInstrument(
figi=ticker['figi'],
depth=1
)
]
)
price = {}
print('subscibe end')
while True:
print('start cycle')
for marketdata in market_data_stream:
print(marketdata.subscribe_order_book_response)
Не смог воспроизвести. У вас точно версия библиотеки 0.2.0-beta40?
Да, была другая версия :( в 0.2.0-beta40 все ок
Что случилось?
ValueError: 8 is not a valid SubscriptionStatus - в момент перебора объектов на подписанные бумаги
Воспроизведение
No response
Tinkoff Invest Version
0.2.0-beta40
Python Version
3.10
OS
Linux
Логи