Query Filled History
FilledHistory
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
| startDate | *string | Query Start Date (Format: YYYYMMDD) |
| endDate | *string (Null default same as Start Date) | Query End Date (Format: YYYYMMDD) |
info
Maximum query range setting is 30 days per query.
Result Return
| Parameter | Type | Description |
|---|---|---|
| IsSuccess | bool | Whether successful |
| Data | *[]FilledData | Returns filled list |
| Message | *string | Returns error message when IsSuccess = false |
Filled Information FilledData Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| Date | *string | Filled Date |
| BranchNo | *string | Branch Code |
| Account | *string | Account |
| SeqNo | *string | Order Sequence Number (Only returned for active reports) |
| OrderNo | *string | Order Number |
| StockNo | *string | Stock Symbol |
| BuySell | BsAction | Buy/Sell Action: BsActionBuy Buy, BsActionSell Sell |
| FilledNo | *string | Fill Sequence Number |
| FilledAvgPrice | *string | Filled Average Price |
| FilledQty | *int64 | Filled Quantity |
| FilledPrice | *string | Filled Price |
| OrderType | OrderType | Order Type: OrderTypeStock Common, OrderTypeMargin Margin, OrderTypeShort Short Sell, OrderTypeDayTrade Day Trade, OrderTypeSbl SBL |
| FilledTime | *string | Filled Time |
| UserDef | *string | User Defined Field (Only returned for active reports) |
Request Example
package main
import (
"fmt"
"fubon"
)
func main() {
// Initialize SDK and login
sdk := fubon.NewSDK()
// ... Login, connection, and other initialization steps ...
// Query Filled History
startDate := "20250401"
endDate := "20250501"
filledHis, err := sdk.Stock.FilledHistory(account, &startDate, &endDate)
// Error Handling
if err != nil {
fmt.Printf("❌ Filled History Format/Parse Error: %v (Type: %T)\n", err, err)
return
}
// Check Success
if !filledHis.IsSuccess {
message := "No message"
if filledHis.Message != nil {
message = *filledHis.Message
}
fmt.Printf("Filled history failed. Message: %s\n", message)
return
}
// Output Filled History List
if filledHis.Data != nil && len(*filledHis.Data) > 0 {
fmt.Printf("✅ Found %d filled records\n", len(*filledHis.Data))
for i, filled := range *filledHis.Data {
fmt.Printf("\n--- Filled %d ---\n", i+1)
fmt.Printf("Date: %s\n", *filled.Date)
fmt.Printf("OrderNo: %s\n", *filled.OrderNo)
fmt.Printf("StockNo: %s\n", *filled.StockNo)
fmt.Printf("BuySell: %v\n", filled.BuySell)
fmt.Printf("FilledQty: %d\n", *filled.FilledQty)
fmt.Printf("FilledPrice: %s\n", *filled.FilledPrice)
fmt.Printf("FilledAvgPrice: %s\n", *filled.FilledAvgPrice)
fmt.Printf("FilledTime: %s\n", *filled.FilledTime)
fmt.Printf("OrderType: %v\n", filled.OrderType)
if filled.UserDef != nil && *filled.UserDef != "" {
fmt.Printf("UserDef: %s\n", *filled.UserDef)
}
}
} else {
fmt.Println("No filled data returned.")
}
}
Response Example
// FilledHistory Return Structure
Result{
IsSuccess: true,
Message: nil,
Data: &[]FilledData{
{
Date: "2025/04/29", // Filled Date
BranchNo: "6460", // Branch Code
Account: "26", // Account
SeqNo: nil, // Order Sequence Number
OrderNo: "bA422", // Order Number
StockNo: "1101", // Stock Symbol
BuySell: Sell, // Buy/Sell Action
FilledNo: "00000000001", // Fill Sequence Number
FilledAvgPrice: "35.2", // Filled Average Price
FilledQty: 1000, // Filled Quantity
FilledPrice: "35.2", // Filled Price
OrderType: Stock, // Order Type
FilledTime: "10:31:00.931", // Filled Time
UserDef: nil, // User Defined
},
// ... more filled records
},
}