Tinkoff / invest-python

Tinkoff Invest Python gRPC client
https://tinkoff.github.io/invest-python/
Apache License 2.0
319 stars 90 forks source link

Ошибка вывода данных при выводе совершенных сделок #217

Closed Neftja closed 1 year ago

Neftja commented 1 year ago

Что случилось?

Не могу понять, что делаю не так (

Воспроизведение

def request_iterator():
        yield MarketDataRequest(
            subscribe_trades_request=SubscribeTradesRequest(
                subscription_action=SubscriptionAction.SUBSCRIPTION_ACTION_SUBSCRIBE,
                instruments=[
                    TradeInstrument(
                        figi="BBG004730N88"                        
                    )
                ],
            )
        )
        while True:
            time.sleep(.1)

    with Client(TOKEN) as client:
        for marketdata in client.market_data_stream.market_data_stream(
            request_iterator()
        ):
            print(marketdata.trade.figi)

Tinkoff Invest Version

0.2.0-beta52

Python Version

3.9

OS

Windows

Логи

Traceback (most recent call last):
  File "c:\Users\Anonymous\Desktop\Trading_bot\get_figi.py", line 111, in <module>
    stream_stakan()
  File "c:\Users\Anonymous\Desktop\Trading_bot\get_figi.py", line 89, in stream_stakan
    print(marketdata.trade.figi)
AttributeError: 'NoneType' object has no attribute 'figi'