RAPTOR v18.4: Исправлена отчетность, активированы выходные
This commit is contained in:
23
invest-python-master/examples/cancel_orders.py
Normal file
23
invest-python-master/examples/cancel_orders.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from t_tech.invest import Client
|
||||
|
||||
TOKEN = os.environ["INVEST_TOKEN"]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
||||
def main():
|
||||
with Client(TOKEN) as client:
|
||||
response = client.users.get_accounts()
|
||||
account, *_ = response.accounts
|
||||
account_id = account.id
|
||||
logger.info("Orders: %s", client.orders.get_orders(account_id=account_id))
|
||||
client.cancel_all_orders(account_id=account.id)
|
||||
logger.info("Orders: %s", client.orders.get_orders(account_id=account_id))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user