Skip to content

KeyError: 'cny' in Overview #163

@Tolyandre

Description

@Tolyandre

Запускаю команду Overview

$ tksbrokerapi --overview --account-id 2162405480
/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/.venv/lib/python3.12/site-packages/pandas_ta/__init__.py:7: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import get_distribution, DistributionNotFound
TKSBrokerAPI.py     L:5930 ERROR   [2025-08-14 06:40:12,519] ⛔ An issue occurred in TKSBrokerAPI Platform! See full debug log in [/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/TKSBrokerAPI.log]. Summary code: 255

Предупреждение "kg_resources is deprecated" вроде бы ни на что не влияет.

Происходит ошибка KeyError: 'cny'. Содержимое лога:

TKSBrokerAPI.py     L:5512 DEBUG   [2025-08-14 06:40:11,822] 🚀 TKSBrokerAPI Platform started at: [2025-08-14 06:40:11] UTC, it is [2025-08-14 06:40:11] local time
TKSBrokerAPI.py     L:5526 DEBUG   [2025-08-14 06:40:11,823] ⚙️ TKSBrokerAPI Platform version used: v1.6.268
TKSBrokerAPI.py     L:553  DEBUG   [2025-08-14 06:40:11,876] 📄 Loaded cached instrument data from [/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/dump.json], last modified [2025-08-14 06:29:50] UTC
TKSBrokerAPI.py     L:5912 DEBUG   [2025-08-14 06:40:12,519] Traceback (most recent call last):
  File "/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/.venv/lib/python3.12/site-packages/tksbrokerapi/TKSBrokerAPI.py", line 5664, in Main
    trader.Overview(show=True, details="full")
  File "/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/.venv/lib/python3.12/site-packages/tksbrokerapi/TKSBrokerAPI.py", line 2180, in Overview
    costRUB = cost if item["instrumentType"] == "currency" else cost * view["raw"]["currenciesCurrentPrices"][currency]["currentPrice"]  # cost in rubles
                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'cny'

TKSBrokerAPI.py     L:5919 DEBUG   [2025-08-14 06:40:12,519] 🛠️ Please, check existing issues or request a new one at https://github.com/Tim55667757/TKSBrokerAPI/issues
TKSBrokerAPI.py     L:5930 ERROR   [2025-08-14 06:40:12,519] ⛔ An issue occurred in TKSBrokerAPI Platform! See full debug log in [/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/TKSBrokerAPI.log]. Summary code: 255
TKSBrokerAPI.py     L:5932 DEBUG   [2025-08-14 06:40:12,519] 🕒 TKSBrokerAPI Platform work duration: [0:00:00.697056]
TKSBrokerAPI.py     L:5933 DEBUG   [2025-08-14 06:40:12,519] 🛬 TKSBrokerAPI Platform finished: [2025-08-14 06:40:12 UTC], it is [2025-08-14 06:40:12] local time

tksbrokerapi установил через pip. Версия:

$ tksbrokerapi --version
/home/toly/Repo/Tolyandre/try/TKSBrokerAPI/.venv/lib/python3.12/site-packages/pandas_ta/__init__.py:7: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import get_distribution, DistributionNotFound
⚙️ TKSBrokerAPI Platform by Fuzzy Technologies, v1.6.268

Technologies · Knowledge · Science
$ python --version
Python 3.12.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions