Tinkoff Investments ist ein beliebter russischer Broker mit einer fortschrittlichen Client-Anwendung für mobile Geräte und Browser. Die Anwendung soll den Handelsprozess vereinfachen und den Schwellenwert für die Eingabe von Investitionen auf ein Minimum reduzieren, um ein möglichst breites Publikum zu erreichen.
Wenn jedoch ernsthafte Investitionen getätigt werden, benötigt der Anleger genaue und detaillierte Daten zu seinem Portfolio, insbesondere um die Wirksamkeit der Investition beurteilen zu können. Und hier entstehen Unklarheiten bei der Anwendung.
Beschreibung des Problems
Ich werde es am Beispiel meines Portfolios (nicht IIS) in einer mobilen Anwendung betrachten. (Ab dem Datum der Veröffentlichung kann der Antrag aktualisiert werden).
Auf dem Hauptbildschirm sehen wir ermutigende Bedeutungen:
Ich habe hier sofort Fragen:
Wie wurde diese Grünmenge und 12,21% berechnet? Außerdem hatte ich vor ein paar Tagen etwas über + 17%, dann habe ich ein Wertpapier mit einem Gewinn fixiert, der Portfoliowert blieb nahezu unverändert, aber dieser grüne "Gesamtprozentsatz" fiel sofort auf 12,21.
Für die ganze Zeit - ist es über mehrere Jahre der Investition? Es gibt auch eine Option: für heute. Und wie viel Prozent habe ich zum Beispiel für ein Jahr?
Mein Portfolio besteht fast ausschließlich aus ausländischen Wertpapieren und USD. Wie wurde es in Rubel umgerechnet: zum Wechselkurs der Zentralbank oder zum Markt?
Wie viel von diesem Betrag werde ich wirklich nach Steuern und Provisionen haben, wenn ich das gesamte Portfolio verkaufe und das Geld abhebe?
, :
+955 644, 2 ?
, , , .
, .
! -.
. 4 +6,67%, 2020 , +31,41%. , , S&P 500 2020 16,26%. , , . , +12,21% , .. 2019 2018 . , , , .
, , :
, ,
,
, ,
, , , , . , USD , .
, Excel, Excel Google Sheets.
, , . , .
Tinkoff API - , .
, API . , .
API
Open API :
https://tinkoffcreditsystems.github.io/invest-openapi/
SDK: Java, C#, Go, NodeJS.
: Python @daxartio,Python @Awethon, Python @Fatal1ty, PHP, Ruby.
, . , DIY Arduino- WiFi, , WEB- - . .., Arduino Wiring ( C++).
Python, - print('Hello World')
. , , API Python.
: , API.
, :
-
PIP tinvest
, Idle, :
import tinvest
API:
client = tinvest.SyncClient(account_data['my_token'])
my_token API key, .
-, API .
:
positions = client.get_portfolio()
, .
. .
operations = client.get_operations(from_=account_data['start_date'], to=account_data['now_date'])
( ):
course_usd = client.get_market_orderbook(figi='BBG0013HGFT4', depth=20
course_eur = client.get_market_orderbook(figi='BBG0013HJJ31', depth=20)
, , :
currencies = client.get_portfolio_currencies()
print
, :
for pos in positions.payload.positions:
print('name:', pos.name)
print('ticker:', pos.ticker)
print('balance:', pos.balance)
print('currency:', pos.average_position_price.currency)
print('price:', pos.average_position_price.value)
print(' ')
- Excel . XlsxWriter:
https://xlsxwriter.readthedocs.io/
import xlsxwriter
excel . - . , , , / :
ecxelFileName = 'tinkoffReport_' + today + '.xlsx'
workbook = xlsxwriter.Workbook(ecxelFileName)
worksheet = workbook.add_worksheet()
, , , , API, :
, , , , , .
: .
Idle, - : ( !)
Python, , , -, .
, , .
Python
, PyCharm.
, PEP8 ( ).
Python : https://www.w3schools.com/
, .
, , . . , , - , , . , , . , https://stackoverflow.com/
3 ( .py) .txt .
main.py - , . , , . API .
data_parser.py - , , .
excel_builder.py - , , main.py .
-
:
(, API):
name -
ticker -
balance -
currency -
ave.price -
exp.yield - ( )
, , , 955 644 (+12,21%) - exp.yield .
, :
market price - (ave.price + exp.yield)
% change - (market_price / ave.price) * 100) - 100)
market value - (market_price * balance)
market value RUB - ( )
ave. % - % change. , . -, .
total value: - ( market value RUB)
, total value 8 782 836, : 8 782 160, --. 0,0077%. , , . - , , .
- !
, , , : .
CB value RUB - .
, 8 749 045 - , , 33 791 , .
ave.buy in RUB - . .
, , , . , , .
, (). , figi , , . , . . , .
, , Tinkoff API , , .
API , , . , , . 15 430 , 1 .
- , , , .
, :
sum.buy in RUB - (ave.buy in RUB * balance)
, 7 178 123 - , , .
tax base - (sum.buy in RUB - CB value RUB)
expected tax - 13%, , .
: 207 145 . - , .
-
, , Tinkoff API. , , :
. , . - .
( )
, , :
, , , !
, .
.
-
.
Investing period - , . , .
, , , - .
PayIn - PayOut - . 5 843 172 - .
Commissions payed - , . 17 315 , 2200 - 2% IPO , . , 15 000 , , , . $1000 18,22 .
, - "" IPO . API .
Taxes payed - , . , , , .
, W8BEN, , , , .
, 117 631 , , , 207, .
: , $100 60 , , 80, $100, 260 , , , 6000, 8000, $ .
Clean portfolio - . , , . , , . , $116000 , - 2000. , . , .
Profit - , . Clean portfolio - (PayIn - PayOut), .., , , . 2 732 519, " " " " , 207. 2500 . , .
-, , .
. , . , , , , , . - XIRR Excel, , . - , .
, , , .
, , , .
, , .
: Excel, Excel, Google Sheets, .
.exe , Python , ( , , ).
Python .
Ich hoffe, dass die Informationen nützlich sind, um die Interaktion mit Tinkoff-Anwendungen zu verbessern, mit APIs zu arbeiten und ähnliche Programme zu entwickeln sowie zu fundierteren Investitionen beizutragen und damit Ihr Wohlbefinden zu steigern. Vielen Dank für das Lesen bis zum Ende.