Skip to main content

已實現損益查詢

realized_profit_and_loses

輸入參數

參數類別說明
accountAccount帳號
start_datestring查詢起始日 ( YYYYMMDD )
end_datestring查詢終止日 ( YYYYMMDD )
symbolstring股票代號

已實現 Realized 欄位

Return type : Object

ParameterTypeDescription
noString編號
costString買入成本
incomeString賣出成本
profit_lossString損益
profit_loss_rateString損益率
accumulated_costString累計成本
accumulated_profit_lossString累計損益
accumulated_profit_loss_rateString累計損益率
short_selling_feeString融券手續費
interestString利息
closed_margin_amountString償還融資金額
dividend_amountString股利金額
securities_lending_differential_feeString券差借券費
profit_loss_summaryList損益摘要
└─ noString編號
└─ t_dateString交易日期
└─ branch_idString分公司代號
└─ cust_idString帳號
└─ nameString客戶姓名
└─ order_typeString委託別 (0 整股, 1,3 融資, 2,4 融券, 9 現賣)
└─ order_type_nameString委託類型名稱
└─ buy_sellString買賣別 (B, S)
└─ symbolString股票代號
└─ symbol_nameString股票名稱
└─ target_priceString標的現價
└─ portfolio_typeString權證種類 -
└─ order_noString委託序號
└─ filled_noString成交序號
└─ closed_quantityString沖銷股數
└─ filled_priceString成交價格
└─ closed_margin_amountString償還融資金額
└─ closed_short_collateralString償還擔保品
└─ closed_guarantee_amountString償還融券保證金
└─ interestString利息
└─ short_selling_feeString借券費
└─ costString成本
└─ cost_before_dividendString成本 (不扣除息金額)
└─ incomeString賣出收入
└─ profit_lossString損益
└─ profit_loss_rateString損益率
└─ other_costString其他費用 ( 除手續費、交易稅外的費用項目 (資/券利息也包含在內) )
└─ close_typeString沖銷類別 (0 現股, 1 融資, 2 融券, 3 信用當沖, 4 現股當沖, 5 現賣)
└─ order_type_name_2String委託類別名稱
└─ dividend_amountString除息金額
└─ securities_lending_differential_feeString券差借券費
buy_detailobject買入詳情
  └─ filled_quantityString成交數量
  └─ filled_amountString成交金額
  └─ net_amountString淨收付
  └─ margin_amountString融資金額
  └─ guarantee_amountString保證金金額
  └─ short_collateralString融券擔保品
  └─ securities_lending_feeString標借費
  └─ adjustment_dateString調整日期
  └─ order_typeString委託別 : 0 整股、1、3融資、2、4融券、 9現賣(擔保品)
  └─ order_type_nameString委託類型名稱
  └─ buy_sellString買賣方向
  └─ change_typeString變更類型
  └─ is_adjustedString是否開放調整成本
  └─ io_flagString異動代碼
  └─ io_nameString異動名稱
  └─ noString編號
  └─ t_dateString交易日期
  └─ order_noString委託序號
  └─ filled_noString成交序號
  └─ closed_quantityString沖銷股數
  └─ filled_priceString成交價格
  └─ closed_margin_amountString償還融資金額
  └─ closed_shortCollateralString償還擔保品
  └─ closed_guarantee_amountString償還融券保證金
  └─ feeString手續費
  └─ interestString利息
  └─ taxString稅金
  └─ short_selling_feeString借券費
  └─ costString成本
  └─ cost_before_dividendString成本 (不扣除息金額)
  └─ incomeString賣出收入
  └─ profit_lossString損益
  └─ profit_loss_rateString損益率
  └─ other_costString其他費用 ( 除手續費、交易稅外的費用項目 (資/券利息也包含在內) )
  └─ close_typeString沖銷類別 : 0現股、1融資、2融券、3信用當沖、4現股當沖、5現賣(未買回)/券差(買進)
  └─ securities_transaction_taxString證所稅
  └─ health_insurance_premiumString健保補充費
  └─ order_type_name2String委託類別
  └─ dividend_amountString除息金額
  └─ securities_lending_differential_feeString券差借券費
sell_detailobject賣出詳情
  └─ filled_quantityString成交數量
  └─ filled_amountString成交金額
  └─ net_amountString淨收付
  └─ margin_amountString融資金額
  └─ guarantee_amountString保證金金額
  └─ short_collateralString融券擔保品
  └─ securities_lending_feeString標借費
  └─ adjustment_dateString調整日期
  └─ order_typeString委託別 : 0 整股、1、3融資、2、4融券、 9現賣(擔保品)
  └─ order_type_nameString委託類型名稱
  └─ buy_sellString買賣方向
  └─ change_typeString變更類型
  └─ is_adjustedString是否開放調整成本
  └─ io_flagString異動代碼
  └─ io_nameString異動名稱
  └─ noString編號
  └─ t_dateString交易日期
  └─ order_noString委託序號
  └─ filled_noString成交序號
  └─ closed_quantityString沖銷股數
  └─ filled_priceString成交價格
  └─ closed_margin_amountString償還融資金額
  └─ closed_shortCollateralString償還擔保品
  └─ closed_guarantee_amountString償還融券保證金
  └─ feeString手續費
  └─ interestString利息
  └─ taxString稅金
  └─ short_selling_feeString借券費
  └─ costString成本
  └─ cost_before_dividendString成本 (不扣除息金額)
  └─ incomeString賣出收入
  └─ profit_lossString損益
  └─ profit_loss_rateString損益率
  └─ other_costString其他費用 ( 除手續費、交易稅外的費用項目 (資/券利息也包含在內) )
  └─ close_typeString沖銷類別 : 0現股、1融資、2融券、3信用當沖、4現股當沖、5現賣(未買回)/券差(買進)
  └─ securities_transaction_taxString證所稅
  └─ health_insurance_premiumString健保補充費
  └─ order_type_name2String委託類別
  └─ dividend_amountString除息金額
  └─ securities_lending_differential_feeString券差借券費

請求範例

sdk.accounting.realized_profit_and_loses(account,"20241101","20241201")

回傳範例

RealizedProfitLossResponse = {
no: "合計", # 編號 ( String )
cost: "83618", # 買入總成本 ( String )
income: "81462", # 賣出總收入 ( String )
profit_loss: "-2156", # 總損益 ( String )
profit_loss_rate: "-2.58%", # 總損益率 ( String )
accumulated_cost: "0", # 累計成本 ( String )
accumulated_profit_loss: "-2156", # 累計損益 ( String )
accumulated_profit_loss_rate: "-2.58%", # 累計損益率 ( String )
short_selling_fee: "0", # 融券手續費 ( String )
interest: "0", # 利息 ( String )
closed_margin_amount : "0", # 償還融資金額 ( String )
dividend_amount : "0", # 股利金額 ( String )
securities_lending_differential_fee : "0", # 券差借券費 ( String )
profit_loss_summary : [
{
no : "1", # 編號 ( String )
t_date : "20240808", # 交易日期 ( String )
filled_no : "0000001", # 成交編號 ( String )
closed_quantity : "1000", # 平倉數量 ( String )
filled_price : "81.70", # 成交價格 ( String )
closed_margin_amount : "0", # 償還融資金額 ( String )
closed_short_collateral : "0", # 償還擔保品 ( String )
closed_guarantee_amount : "0", # 償還保證金 ( String )
interest : "0", # 利息 ( String )
short_selling_fee : "0", # 融券費用 ( String )
cost : "83618", # 買入成本 ( String )
cost_before_dividend : "83618", # 買入成本 (未扣除股息) ( String )
income : "81462", # 賣出收入 ( String )
profit_loss : "-2156", # 損益 ( String )
profit_loss_rate : "-2.58%", # 損益率 ( String )
other_cost : "0", # 其他成本 ( String )
closed_type : "4", # 平倉類型 ( String )
order_type_name2 : "現沖", # 委託類型名稱2 ( String )
dividend_amount : "0", # 股息金額 ( String )
securities_lending_differential_fee : "0", # 券差借券費 ( String )
branch_id : "5920", # 分公司代號 ( String )
cust_id : "9816000", # 客戶帳號 ( String )
name : "陳XXX", # 客戶姓名 ( String )
order_type : "0", # 委託類型 ( String )
order_type_name : "現股", # 委託類型名稱 ( String )
buy_sell : "Sell", # 買賣方向 ( String )
symbol : "3663", # 股票代號 ( String )
symbol_name : "鑫科", # 股票名稱 ( String )
target_price : "0", # 標的價格 ( String )
portfolio_type : "", # 投資組合類型 ( String )
buy_detail: RealizedProfitLossDetail {
no : "1", # 編號 ( String )
t_date : "20240808", # 交易日期 ( String )
order_no : "o0179", # 委託序號 ( String )
filled_no : "0000002", # 成交編號 ( String )
closed_quantity : "1000", # 平倉股數 ( String )
filled_price : "83.50", # 成交價格 ( String )
closed_margin_amount : "0", # 償還融資金額 ( String )
closed_short_collateral : "0", # 償還擔保品 ( String )
closed_guarantee_amount : "0", # 償還保證金 ( String )
fee : "118", # 手續費 ( String )
interest : "0", # 利息 ( String )
tax : "0", # 稅金 ( String )
short_selling_fee : "0", # 融券費用 ( String )
cost : "83618", # 買入成本 ( String )
cost_before_dividend : "83618", # 買入成本 (未扣除股息) ( String )
income : "81462", # 賣出收入 ( String )
profit_loss : "-2156", # 損益 ( String )
profit_loss_rate : "-2.58%", # 損益率 ( String )
other_cost : "0", # 其他成本 ( String )
closed_type : "4", # 平倉類型 ( String )
securities_transaction_tax : "0", # 證券交易稅 ( String )
health_insurance_premium : "0", # 健保費用 ( String )
order_type_name2 : "買沖", # 委託類型名稱2 ( String )
dividend_amount : "0", # 股息金額 ( String )
securities_lending_differential_fee : "0", # 券差借券費 ( String )
filled_quantity : "1000", # 成交數量 ( String )
filled_amount : "83500", # 成交金額 ( String )
net_amount : "-83618", # 淨支付金額 ( String )
margin_amount : "0", # 融資金額 ( String )
guarantee_amount : "0", # 保證金金額 ( String )
short_collateral : "0", # 融券擔保品 ( String )
securities_lending_fee : "0", # 證券借貸費用 ( String )
adjustment_date : "", # 調整日期 ( String )
order_type : "0", # 委託類型 ( String )
order_type_name : "現股", # 委託類型名稱 ( String )
buy_sell : "B", # 買賣方向 ( String )
change_type : "0", # 變更類型 ( String )
is_adjusted : "N", # 是否已調整 ( String )
io_flag : "", # 異動代碼 ( String )
io_name : "", # 異動名稱 ( String )
},
sell_detail : RealizedProfitLossDetail {
no : "1", # 編號 ( String )
t_date : "20240808", # 交易日期 ( String )
order_no : "g0050", # 委託序號 ( String )
filled_no : "0000001", # 成交編號 ( String )
closed_quantity : "1000", # 平倉股數 ( String )
filled_price : "81.70", # 成交價格 ( String )
closed_margin_amount : "0", # 償還融資金額 ( String )
closed_short_collateral : "0", # 償還擔保品 ( String )
closed_guarantee_amount : "0", # 償還保證金 ( String )
fee : "116", # 手續費 ( String )
interest : "0", # 利息 ( String )
tax : "122", # 稅金 ( String )
short_selling_fee : "0", # 融券費用 ( String )
cost : "0", # 成本 ( String )
cost_before_dividend : "0", # 成本 (未扣除股息) ( String )
income : "81462", # 賣出收入 ( String )
profit_loss : "0", # 損益 ( String )
profit_loss_rate : "100.00%", # 損益率 ( String )
other_cost : "0", # 其他成本 ( String )
closed_type : "4", # 平倉類型 ( String )
securities_transaction_tax : "0", # 證券交易稅 ( String )
health_insurance_premium : "0", # 健保費用 ( String )
order_type_name2 : "賣沖", # 委託類型名稱2 ( String )
dividend_amount : "0", # 股息金額 ( String )
securities_lending_differential_fee : "0", # 券差借券費 ( String )
filled_quantity : "1000", # 成交數量 ( String )
filled_amount : "81700", # 成交金額 ( String )
net_amount : "81462", # 淨收入金額 ( String )
margin_amount : "0", # 融資金額 ( String )
guarantee_amount : "0", # 保證金金額 ( String )
short_collateral : "0", # 融券擔保品 ( String )
securities_lending_fee : "0", # 證券借貸費用 ( String )
adjustment_date : "", # 調整日期 ( String )
order_type : "0", # 委託類型 ( String )
order_type_name : "現股", # 委託類型名稱 ( String )
buy_sell : "S", # 買賣方向 ( String )
change_type : "", # 變更類型 ( String )
is_adjusted : None, # 是否已調整 ( None 或 String )
io_flag : "", # 異動代碼 ( String )
io_name : "", # 異動名稱 ( String )
}
}

]
}