Day Trade Stock Info Query
DaytradeAndStockInfo
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
| stockNo | string | Stock Symbol |
Result Return
| Parameter | Type | Description |
|---|---|---|
| IsSuccess | bool | Whether successful |
| Data | *DayTradeStockInfo | Returns quota information |
| Message | *string | Returns error message when IsSuccess = false |
Quota Information DayTradeStockInfo Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| StockNo | *string | Stock Symbol |
| Date | *string | Date |
| DaytradeOrigQuota | *int64 | Original Day Trade Short Quota |
| DaytradeTradableQuota | *int64 | Tradable Day Trade Short Quota |
| PrecollectSingle | *int64 | Single Pre-collect Share Count (Returns nil if not required) |
| PrecollectAccumulate | *int64 | Accumulated Pre-collect Share Count (Returns nil if not required) |
| Status | *int64 | Status (bitmask sum): 0 All Disabled, 1 Short selling allowed below flat, 2 SBL selling allowed below flat, 4 Day trade allowed (Buy then Sell), 8 Day trade allowed (Sell then Buy) |
| DispositionStatus | *string | Disposition Status { SETTYPE : 1} : Full Delivery, { MARK-W : 1} : Warning, { MARK-P : 1} : Attention, { MARK-L : 1} : Order Restricted |
info
Status Example Explanation: If Status = 15, it is the decomposition of 1 (Short selling allowed below flat) + 2 (SBL selling allowed below flat) + 4 (Day trade buy-sell) + 8 (Day trade sell-buy). If Status = 3, it is 1 + 2. Others follow the same logic.
Request Example
package main
import (
"fmt"
"fubon"
)
func main() {
// Initialize SDK and login
sdk := fubon.NewSDK()
// ... Login, connection, and other initialization steps ...
// Query Day Trade Stock Info
stockNo := "2330"
daytradeStock, err := sdk.Stock.DaytradeAndStockInfo(account, stockNo)
// Error handling
if err != nil {
fmt.Printf("❌ DayTrade Stock Info Format/Parse Error: %v (Type: %T)\n", err, err)
return
}
// Check success
if !daytradeStock.IsSuccess {
message := "No message"
if daytradeStock.Message != nil {
message = *daytradeStock.Message
}
fmt.Printf("DayTrade Stock Info failed. Message: %s\n", message)
return
}
// Output quota information
if daytradeStock.Data != nil {
fmt.Println("✅ DayTrade Stock Info:")
fmt.Printf("StockNo: %s\n", *daytradeStock.Data.StockNo)
fmt.Printf("Date: %s\n", *daytradeStock.Data.Date)
fmt.Printf("Original Day Trade Short Quota: %d\n", *daytradeStock.Data.DaytradeOrigQuota)
fmt.Printf("Tradable Day Trade Short Quota: %d\n", *daytradeStock.Data.DaytradeTradableQuota)
} else {
fmt.Println("No DayTrade Stock Info data returned.")
}
}
Response Example
// DaytradeAndStockInfo Return Structure
Result{
IsSuccess: true,
Message: nil,
Data: &DayTradeStockInfo{
StockNo: "3264", // Stock Symbol
Date: "2023/10/04", // Date
DaytradeOrigQuota: 0, // Original Day Trade Short Quota
DaytradeTradableQuota: 0, // Tradable Day Trade Short Quota
PrecollectSingle: nil, // Single Pre-collect Share Count (Not required)
PrecollectAccumulate: nil, // Accumulated Pre-collect Share Count (Not required)
Status: 0, // Status (All Disabled)
DispositionStatus: "", // Disposition Status
},
}