Tinkoff / invest-python

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

[Bug] get_candles не возвращает данные для некоторых инструментов #245

Closed GarikFirst closed 11 months ago

GarikFirst commented 11 months ago

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

get_candles не возвращает данные для некоторых инструментов, например LKOH, KMAZ и многие другие

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

from datetime import datetime, timezone
from tinkoff.invest import CandleInterval, Client

client = Client(
    «MYTOKEN"
)

tickers = ["LKOH", "AMD"]

with client as client:
    for ticker in tickers:
        print(ticker)

        instrument = [
            r
            for r in client.instruments.find_instrument(query=ticker).instruments
            if r.ticker == ticker
        ][0]

        candles = client.market_data.get_candles(
            instrument_id=instrument.figi,
            from_=datetime(2023, 8, 1).replace(tzinfo=timezone.utc),
            to=datetime(2023, 8, 2).replace(tzinfo=timezone.utc),
            interval=CandleInterval.CANDLE_INTERVAL_1_MIN,
        ).candles

        for candle in candles:
            print(candle)

Получаю:
LKOH
AMD
HistoricCandle(open=Quotation(units=114, nano=850000000), high=Quotation(units=114, nano=850000000), low=Quotation(units=114, nano=840000000), close=Quotation(units=114, nano=850000000), volume=204, time=datetime.datetime(2023, 8, 1, 5, 1, tzinfo=datetime.timezone.utc), is_complete=True)
HistoricCandle(open=Quotation(units=114, nano=910000000), high=Quotation(units=114, nano=940000000), low=Quotation(units=114, nano=910000000), close=Quotation(units=114, nano=940000000), volume=203, time=datetime.datetime(2023, 8, 1, 5, 5, tzinfo=datetime.timezone.utc), is_complete=True)
...

Tinkoff Invest Version

0.2.0-beta54

Python Version

3.10

OS

Mac OS

Логи

No response

GarikFirst commented 11 months ago

Отбой, был неверный фиги