Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_TI_API_2-master/Account_n_Portfolio.py
5918 views
1
import tinkoff.invest
2
import intro.basek
3
import intro.accid
4
5
TOKEN = intro.basek.TINKOFF_INVEST_DOG_NEW
6
SDK = tinkoff.invest.Client(TOKEN)
7
User_acc_ID = intro.accid.ACC_ID
8
9
# Для полученния ID
10
def get_account_info():
11
with SDK as client:
12
gai = client.users.get_accounts()
13
print(gai)
14
15
16
get_account_info()
17
18
# Для получения Портфеля
19
def show_portfolio():
20
with SDK as client:
21
portfel = client.operations.get_portfolio(account_id=User_acc_ID)
22
print(portfel)
23
24
return
25
26
# show_portfolio()
27
28
29