RAPTOR v18.4: Исправлена отчетность, активированы выходные
This commit is contained in:
26
invest-python-master/examples/operations_stream.py
Normal file
26
invest-python-master/examples/operations_stream.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
|
||||
from t_tech.invest import Client
|
||||
from t_tech.invest.schemas import OperationsStreamRequest, PingDelaySettings
|
||||
|
||||
TOKEN = os.environ["INVEST_TOKEN"]
|
||||
|
||||
|
||||
def main():
|
||||
with Client(TOKEN) as client:
|
||||
accounts = client.users.get_accounts().accounts
|
||||
accounts = [i.id for i in accounts]
|
||||
print(f"Subscribe for operations on accounts: {accounts}")
|
||||
for operation in client.operations_stream.operations_stream(
|
||||
OperationsStreamRequest(
|
||||
accounts=accounts,
|
||||
ping_settings=PingDelaySettings(
|
||||
ping_delay_ms=5000,
|
||||
),
|
||||
)
|
||||
):
|
||||
print(operation)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user