コード例 #1
0
ファイル: ibc.py プロジェクト: andrey-zotov/ib_console
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)
コード例 #2
0
ファイル: ibc.py プロジェクト: andrey-zotov/ib_console
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)
コード例 #3
0
ファイル: ibc.py プロジェクト: andrey-zotov/ib_console
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()