Closed shobnaren closed 1 year ago
Sure, anything specific you'd like samples on?
start from login, order submission, order status, cancel order, open positions and close all open position, flip position (long to short, short to long) etc.
sample code: `import os import asyncio
from TradovatePy.models.session import Session from TradovatePy.accounting import Accounting
params = { "environment": os.getenv("TO_ENV"), "username": os.getenv("TO_USERID"), "password": os.getenv("TO_PASSWD"), "secret_key": os.getenv("TO_SECRET"), "device_id": os.getenv("TO_DEVID"), "app_version": os.getenv("TO_APPVER"), "app_id": os.getenv("TO_APPID"), "cid": os.getenv("TO_CID"), }
s = Session(**params) if True: a = Accounting(s) out = asyncio.run(a.account_list()) print(out)`
but this one - throws below error as providing the account_list response - https://bugs.python.org/issue36709 Is there any safe handling of it - is there sample further or better way of using code - please share.
Can you please add a working example of how to connect to tradeovate, get your account balances/positions and place a trade?
@shobnaren
Sorry for wait this was just fixed: https://github.com/antonio-hickey/TradovatePy/commit/b589ad6633212a31fecc45ade537b0285f743464
Can you please add samples