Comments (4)
Versions 1.2.* make more duplicated request when mixed FIGIs and tickers, for example:
$ tksbrokerapi % python3 TKSBrokerAPI.py -v 10 --prices POSI TGLD UNKNOWN BBG222222222 TCS00A103X66 POSI TGLD POSI TGLD GAZP EUR BBG0013HJJ31 BBG0013HJJ31
TKSBrokerAPI.py L:3109 DEBUG [2022-09-05 21:17:52,585] TKSBrokerAPI module started at: [2022-09-05 18:17:52] UTC, it is [2022-09-05 21:17:52] local time
TKSBrokerAPI.py L:207 DEBUG [2022-09-05 21:17:52,585] Bearer token for Tinkoff OpenApi set up from environment variable `TKS_API_TOKEN`. See https://tinkoff.github.io/investAPI/token/
TKSBrokerAPI.py L:219 DEBUG [2022-09-05 21:17:52,585] String with user's numeric account ID in Tinkoff Broker set up from environment variable `TKS_ACCOUNT_ID`
TKSBrokerAPI.py L:249 DEBUG [2022-09-05 21:17:52,585] Broker API server: https://invest-public-api.tinkoff.ru/rest
TKSBrokerAPI.py L:310 DEBUG [2022-09-05 21:17:52,609] Local cache with raw instruments data is used: [dump.json]
TKSBrokerAPI.py L:311 DEBUG [2022-09-05 21:17:52,609] Dump file was last modified [2022-09-05 17:44:28] UTC
TKSBrokerAPI.py L:1091 DEBUG [2022-09-05 21:17:52,609] Requesting current prices of list of instruments from Tinkoff Broker server...
TKSBrokerAPI.py L:1104 DEBUG [2022-09-05 21:17:52,609] Ordered input list of instruments without duplicates of names: ['POSI', 'TGLD', 'UNKNOWN', 'BBG222222222', 'TCS00A103X66', 'GAZP', 'EUR_RUB__TOM', 'BBG0013HJJ31']
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:52,609] Requesting current prices for instrument with ticker [POSI] and FIGI [TCS00A103X66]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:52,718] Requesting current prices for instrument with ticker [TGLD] and FIGI [BBG222222222]...
TKSBrokerAPI.py L:1119 WARNING [2022-09-05 21:17:52,816] Instrument [UNKNOWN] not in list of available instruments for current token!
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:52,817] Requesting current prices for instrument with ticker [TGLD] and FIGI [BBG222222222]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:52,902] Requesting current prices for instrument with ticker [POSI] and FIGI [TCS00A103X66]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:52,993] Requesting current prices for instrument with ticker [GAZP] and FIGI [BBG004730RP0]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:53,081] Requesting current prices for instrument with ticker [EUR_RUB__TOM] and FIGI [BBG0013HJJ31]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:17:53,173] Requesting current prices for instrument with ticker [EUR_RUB__TOM] and FIGI [BBG0013HJJ31]...
TKSBrokerAPI.py L:1160 INFO [2022-09-05 21:17:53,444] Only unique instruments are shown:
# Actual prices at: [2022-09-05 18:17 UTC]
| Ticker | FIGI | Type | Prev. close | Last price | Chg. % | Day limits min/max | Actual sell / buy | Curr.
|--------------|--------------|------------|-------------|-------------|----------|---------------------|---------------------|------
| POSI | TCS00A103X66 | Shares | 1273.00 | 1273.00 | 0.00% | 875.2 / 1559.6 | N/A / N/A | rub
| TGLD | BBG222222222 | Etfs | 0.07 | 0.07 | +0.14% | 0.0636 / 0.07780000000000001 | N/A / N/A | usd
| GAZP | BBG004730RP0 | Shares | 250.00 | 250.00 | 0.00% | 225.0 / 275.0 | N/A / N/A | rub
| EUR_RUB__TOM | BBG0013HJJ31 | Currencies | 60.84 | 60.12 | -1.17% | 55.73 / 65.9125 | N/A / N/A | rub
TKSBrokerAPI.py L:1166 INFO [2022-09-05 21:17:53,446] Price list for all instruments saved to file: [prices.md]
TKSBrokerAPI.py L:3361 DEBUG [2022-09-05 21:17:53,446] All operations with Tinkoff Server using Open API are finished success (summary code is 0).
TKSBrokerAPI.py L:3368 DEBUG [2022-09-05 21:17:53,446] TKSBrokerAPI module work duration: [0:00:00.860501]
TKSBrokerAPI.py L:3369 DEBUG [2022-09-05 21:17:53,446] TKSBrokerAPI module finished: [2022-09-05 18:17:53] UTC, it is [2022-09-05 21:17:53] local time
from tksbrokerapi.
Fixed in versions 1.3.*
Now TKSBrokerAPI not request prices for duplicated instruments and saving working time (see example below and strings in logs with Requesting current prices for instrument with...
and work duration):
$ tksbrokerapi % python3 TKSBrokerAPI.py -v 10 --prices POSI TGLD UNKNOWN BBG222222222 TCS00A103X66 POSI TGLD POSI TGLD GAZP EUR BBG0013HJJ31 BBG0013HJJ31
TKSBrokerAPI.py L:3108 DEBUG [2022-09-05 21:53:41,431] TKSBrokerAPI module started at: [2022-09-05 18:53:41] UTC, it is [2022-09-05 21:53:41] local time
TKSBrokerAPI.py L:207 DEBUG [2022-09-05 21:53:41,431] Bearer token for Tinkoff OpenApi set up from environment variable `TKS_API_TOKEN`. See https://tinkoff.github.io/investAPI/token/
TKSBrokerAPI.py L:219 DEBUG [2022-09-05 21:53:41,431] String with user's numeric account ID in Tinkoff Broker set up from environment variable `TKS_ACCOUNT_ID`
TKSBrokerAPI.py L:249 DEBUG [2022-09-05 21:53:41,431] Broker API server: https://invest-public-api.tinkoff.ru/rest
TKSBrokerAPI.py L:310 DEBUG [2022-09-05 21:53:41,462] Local cache with raw instruments data is used: [dump.json]
TKSBrokerAPI.py L:311 DEBUG [2022-09-05 21:53:41,462] Dump file was last modified [2022-09-05 17:44:28] UTC
TKSBrokerAPI.py L:1102 DEBUG [2022-09-05 21:53:41,462] Requested instruments without duplicates of tickers and FIGIs: ['POSI', 'TGLD', 'UNKNOWN', 'BBG222222222', 'TCS00A103X66', 'GAZP', 'EUR_RUB__TOM', 'BBG0013HJJ31']
TKSBrokerAPI.py L:1117 WARNING [2022-09-05 21:53:41,463] Instrument [UNKNOWN] not in list of available instruments for current token!
TKSBrokerAPI.py L:1122 DEBUG [2022-09-05 21:53:41,464] Unique list of FIGIs: ['TCS00A103X66', 'BBG222222222', 'BBG004730RP0', 'BBG0013HJJ31']
TKSBrokerAPI.py L:1123 DEBUG [2022-09-05 21:53:41,464] Requesting current prices from Tinkoff Broker server...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:53:41,464] Requesting current prices for instrument with ticker [POSI] and FIGI [TCS00A103X66]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:53:41,562] Requesting current prices for instrument with ticker [TGLD] and FIGI [BBG222222222]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:53:41,639] Requesting current prices for instrument with ticker [GAZP] and FIGI [BBG004730RP0]...
TKSBrokerAPI.py L:864 DEBUG [2022-09-05 21:53:41,736] Requesting current prices for instrument with ticker [EUR_RUB__TOM] and FIGI [BBG0013HJJ31]...
TKSBrokerAPI.py L:1159 INFO [2022-09-05 21:53:41,820] Only unique instruments are shown:
# Actual prices at: [2022-09-05 18:53 UTC]
| Ticker | FIGI | Type | Prev. close | Last price | Chg. % | Day limits min/max | Actual sell / buy | Curr.
|--------------|--------------|------------|-------------|-------------|----------|---------------------|---------------------|------
| POSI | TCS00A103X66 | Shares | 1273.00 | 1273.00 | 0.00% | 875.2 / 1559.6 | N/A / N/A | rub
| TGLD | BBG222222222 | Etfs | 0.07 | 0.07 | +0.14% | 0.0636 / 0.07780000000000001 | N/A / N/A | usd
| GAZP | BBG004730RP0 | Shares | 250.00 | 250.00 | 0.00% | 225.0 / 275.0 | N/A / N/A | rub
| EUR_RUB__TOM | BBG0013HJJ31 | Currencies | 60.84 | 60.12 | -1.17% | 55.73 / 65.9125 | N/A / N/A | rub
TKSBrokerAPI.py L:1165 INFO [2022-09-05 21:53:41,822] Price list for all instruments saved to file: [prices.md]
TKSBrokerAPI.py L:3360 DEBUG [2022-09-05 21:53:41,822] All operations with Tinkoff Server using Open API are finished success (summary code is 0).
TKSBrokerAPI.py L:3367 DEBUG [2022-09-05 21:53:41,822] TKSBrokerAPI module work duration: [0:00:00.391130]
TKSBrokerAPI.py L:3368 DEBUG [2022-09-05 21:53:41,823] TKSBrokerAPI module finished: [2022-09-05 18:53:41] UTC, it is [2022-09-05 21:53:41] local time
from tksbrokerapi.
Also fixed in Overview()
method
from tksbrokerapi.
Debug build for this task: tksbrokerapi 1.3.dev67.
PyPI: https://pypi.org/project/tksbrokerapi/1.3.dev67/
from tksbrokerapi.
Related Issues (20)
- Implement bool filter with Rules for Opening/Closing positions by fuzzy Risk/Reach levels HOT 3
- Implement methods for calculation fuzzy Risk and fuzzy Reach levels HOT 3
- Implement new scenario example: detect anomaly volumes of Buyers/Sellers in the order book and send TG notifications HOT 15
- KeyError: 'candles' when download some histories HOT 1
- KeyError: 'convertible_bonds' when request user info HOT 1
- ModuleNotFoundError: No module named 'Templates' HOT 2
- Bug: `ValueError: Given date string *** not likely a datetime present at position ***` HOT 1
- Incorrect values in `view["stat"]["funds"]` record HOT 1
- KeyError: 'OPERATION_TYPE_OUT_STAMP_DUTY' in `TKS_OPERATION_TYPES` constant HOT 1
- Update operation type counts in Deals report HOT 1
- KeyError: 'name' occurred in `Overview()` method HOT 1
- `RUB000UTSTOM` FIGI not in dump.json HOT 1
- Add round to `History()` method when save as CSV-file
- Ошибка при запуске скрипта ТГ-бота HOT 3
- trader.Overview HOT 4
- No module named 'Templates' HOT 2
- TypeError during `--bonds-xlsx` request HOT 1
- Error
- KeyError: 'name'
- TKSBrokerAPI- 1,6 Telegram API HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tksbrokerapi.