Margin Quota Query
MarginQuota
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| account | Account | Account |
| stockNo | string | Stock Symbol |
Result Return
| Parameter | Type | Description |
|---|---|---|
| IsSuccess | bool | Whether successful |
| Data | *MarginShortQuota | Returns quota information |
| Message | *string | Returns error message when IsSuccess = false |
Quota Information MarginShortQuota Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| StockNo | *string | Stock Symbol |
| Date | *string | Date |
| ShortsellOrigQuota | *int64 | Original Short Sell Quota |
| ShortsellTradableQuota | *int64 | Tradable Short Sell Quota |
| MarginOrigQuota | *int64 | Original Margin Quota |
| MarginTradableQuota | *int64 | Tradable Margin Quota |
| MarginRatio | *int64 | Margin Ratio |
| ShortRatio | *int64 | Short Sell Ratio |
info
Quota Description: 0 - No quota / Greater than 0 - Has quota / nil - Unlimited
Request Example
package main
import (
"fmt"
"fubon"
)
func main() {
// Initialize SDK and login
sdk := fubon.NewSDK()
// ... Login, connection, and other initialization steps ...
// Query Margin Quota
stockNo := "2330"
marginQuo, err := sdk.Stock.MarginQuota(account, stockNo)
// Error handling
if err != nil {
fmt.Printf("❌ Margin Quota Format/Parse Error: %v (Type: %T)\n", err, err)
return
}
// Check success
if !marginQuo.IsSuccess {
message := "No message"
if marginQuo.Message != nil {
message = *marginQuo.Message
}
fmt.Printf("Margin Quota failed. Message: %s\n", message)
return
}
// Output quota information
if marginQuo.Data != nil {
fmt.Println("✅ Margin/Short Quota:")
fmt.Printf("StockNo: %s\n", *marginQuo.Data.StockNo)
fmt.Printf("Date: %s\n", *marginQuo.Data.Date)
}
Response Example
// MarginQuota Return Structure
Result{
IsSuccess: true,
Message: nil,
Data: &MarginShortQuota{
StockNo: "2330", // Stock Symbol
Date: "2024/01/24", // Date
ShortsellOrigQuota: 894, // Original Short Sell Quota
ShortsellTradableQuota: 894, // Tradable Short Sell Quota
MarginOrigQuota: nil, // Original Margin Quota (Unlimited)
MarginTradableQuota: nil, // Tradable Margin Quota (Unlimited)
MarginRatio: 60, // Margin Ratio 60%
ShortRatio: 90, // Short Sell Ratio 90%
},
}