def run_monitor(args): """ Run monitor while there are active trades or continuously """ Console.print('Starting monitor...') with bot.Service() as svc: Console.print('Account: ' + svc.active_account.code) __run_monitor(svc)
def run_account(args): """ Display account status """ Console.print('Retrieving account status...') with bot.Service() as svc: Console.print('Account: ' + svc.active_account.code) acc = svc.refresh_account() Console.print_account(acc) Console.print_account_positions(acc)
def run_ls(args): """ Display accounts and orders """ Console.print('Listing orders...') with bot.Service() as svc: Console.print('Account: ' + svc.active_account.code) svc.refresh_account() acc = svc.active_account Console.print_account(acc) Console.print_account_positions(acc) orders = svc.active_account.orders for order in orders: Console.print_order(order) Console.print()