Skip to content

Profit loss detail

Query account of profit loss detail

First, you need get profit loss.

In

using System;
using Sinopac.Shioaji;

Shioaji _api = new Shioaji();
var _accounts = _api.Login("YOUR_PERSON_ID", "YOUR_PASSWORD");

var listProfitLossDetail = _api.ListProfitLossDetail(detail_id:1);
Console.WriteLine(listProfitLossDetail);

Out

[
    {
        date=2021-03-11, 
        cond=Cash, 
        code=2031, 
        quantity=1, 
        price=39.95, 
        cost=39969, 
        dseq=IN383, 
        rep_margintrading_amt=0, 
        rep_collateral=0, 
        rep_margin=0, 
        fee=19, 
        interest=0, 
        tax=0, 
        shortselling_fee=0, 
        currency=NTD, 
        trade_type=Common, 
    }
]

Attributes:

Name Type Description
date str trade date
cond StockOrderCond Cash, Netting, MarginTrading, ShortSelling
code str contract id
quantity int quantity
price float price
cost int cost of price
dseq str detail seqno no
rep_margintrading_amt int repay amount of margin trading
rep_collateral int repay collateral
rep_margin int repay margin
fee int fee
interest int interest
tax str trading tax
shortselling_fee int fee of short selling
currency str NTD, USD, HKD, EUR, CAD, BAS