Skip to content

查詢狀態

提醒

必須先登入及啟用憑證

在取得 Trade 狀態前,必須先利用UpdateStatus進行更新。如果無法成功刪單或改單,你可以對特定trade物件進行更新,並確認在trade中的OrderStatus,是否為可刪改狀態。

取得證券委託狀態

In

_api.UpdateStatus(_api.StockAccount);
Console.WriteLine(_api.ListTrades());

Out

[
    {
        contract={
            security_type=STK, 
            code=1101, 
            exchange=TSE, 
            limit_up=0, 
            limit_down=0, 
            reference=0, 
            margin_trading_balance=0, 
            short_selling_balance=0, 
            day_trade=No,
        }, 
        order={
            action=Buy, 
            price=37.65, 
            quantity=1, 
            price_type=LMT, 
            order_type=ROD, 
            order_lot=Common, 
            order_cond=Cash, 
            first_sell=No,
            id=fd55a308, 
            seqno=025054, 
            ordno=WA085,
            custom_field=test,  
            account={
                account_type=S, 
                person_id=PAPIUSER07, 
                broker_id=9A95, 
                account_id=0512999, 
                signed=True,
            },
        }, 
        status={
            id=fd55a308, 
            status=Submitted, 
            status_code=00, 
            order_ts=1609385617, 
            modified_ts=1609385592, 
            modified_price=0, 
            deal_quantity=0, 
            cancel_quantity=0, 
            deals=System.Collections.Generic.List`1[Sinopac.Shioaji.Deal],
        },
    }
]