Models
Response data models and streaming message types in Go SDK
All models are Go structs. Import from the relevant package.
Pointer fields (*float64, *int, *string) are nil when the server did not send that value; this is different from a value of 0. Check for nil before reading.
Package Structure
ssi-sdk-go/v3/
├── ssi/ → Auth, Data, Trading, Stream (main import)
├── auth/ → Token, OTPResponse
├── account/ → Account, AccountType
├── market/ → OHLCData, MarketIndexes, MarketIndexSummary, SecuritiesInfo, SecuritiesSummary, MasterData, CorporateAction
├── trading/ → PlaceOrderResponse, ModifyOrderResponse, CancelOrderResponse, MaxBuySellResponse, Batch*, FCOInfo, FCOListResponse, FCOOrder, ...
├── portfolio/ → EquityAccountBalance, DerivativeAccountBalance, EquityPosition, DerivativePosition, Order
├── stream/ → TradeMessage, QuoteMessage, IndexTickMessage, OrderStatusMessage, PortfolioMessage, FCOOrderUpdateMessage, ...
├── tradingws/ → Service (Trading WebSocket), Response, OrderBookQuery
└── (root) → SSIError, APIError, AuthenticationError, ...Authentication
Token
| Field | Type | Description |
|---|---|---|
AccessToken | string | Access token |
TokenType | string | Token type (default "Bearer") |
ExpiresAt | int64 | Expiration time, Unix epoch seconds |
RefreshToken | string | Refresh token |
RefreshTokenExpiresAt | int64 | Refresh token expiration, Unix epoch seconds (server key refreshExpiresAt) |
Methods: EffectiveExpiresAt(), CanRefresh(). String() / GoString() never print the tokens.
OTPResponse
Returned by RequestOTPTyped().
| Field | Type | Description |
|---|---|---|
Message | string | Server message |
TransactionID | string | Transaction id, only for Smart OTP. Pass it to Authenticate / EnsureAuthenticated |
Account
Account
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
AccountType | *account.AccountType | "Cash", "Margin" or "Derivative". nil when missing; an unknown value is kept as its raw string (see Enums) |
Market Data
OHLCData
| Field | Type | Description |
|---|---|---|
Symbol | string | Stock symbol |
TradingDate | string | Trading date |
OpenPrice | float64 | Open price |
HighPrice | float64 | High price |
LowPrice | float64 | Low price |
ClosePrice | float64 | Close price |
Volume | int | Volume |
Value | float64 | Trade value |
MarketIndexes
| Field | Type | Description |
|---|---|---|
Index | string | Index code |
IndexName | string | Index name |
Board | *market.Board | Board, nil if the value is not a known board |
BoardRaw | *string | The board exactly as the server sent it |
MarketIndexSummary
| Field | Type | Description |
|---|---|---|
TradingDate | string | Trading date |
IndexValue | float64 | Index value |
IndexChange | float64 | Change |
IndexChangePercent | float64 | Change (%) |
TotalTrade | int | Total trade volume |
TotalTradeValue | float64 | Total trade value |
TotalAdvanceStock | int | Advancing stocks |
TotalDeclineStock | int | Declining stocks |
TotalSteadyStock | int | Unchanged stocks (server key totalNoChangeStock) |
TotalMatch | int | Total matched volume |
TotalMatchValue | float64 | Total matched value |
TotalDeal | int | Total deal volume |
TotalDealValue | float64 | Total deal value |
TotalCeilingStock | int | Ceiling stocks |
TotalFloorStock | int | Floor stocks |
TotalPropBuy | int | Total proprietary buy volume |
TotalPropBuyValue | float64 | Total proprietary buy value |
TotalPropSell | int | Total proprietary sell volume |
TotalPropSellValue | float64 | Total proprietary sell value |
TotalBuyForeign / TotalBuyForeignValue | *float64 | Foreign buy volume / value |
TotalSellForeign / TotalSellForeignValue | *float64 | Foreign sell volume / value |
NetPurchasesForeignVolume / NetPurchasesForeignValue | *float64 | Foreign net purchase volume / value |
Note:
MarketIndexSummaryhas no dedicatedIndex/Boardfield — use the method's query parameter (GetIndexSummary(index)/GetBoardSummary(board)) to scope the result.
SecuritiesInfo
A missing value is nil, not 0 / empty string.
| Field | Type | Description |
|---|---|---|
Symbol | string | Stock symbol |
Board | *market.Board | Board |
Index | string | Index |
SymbolNameVi | string | Vietnamese name |
SymbolNameEn | string | English name |
LotSize | *int | Lot size |
ListedShares | *int | Listed shares |
ICBCode | *string | ICB code |
ICBName | *string | ICB name |
MaturityDate | *string | Maturity date |
FirstTradingDate | *string | First trading date |
LastTradingDate | *string | Last trading date |
CWUnderlyingSymbol | *string | CW underlying symbol |
CWExercisePrice | *float64 | CW exercise price |
CWExecutionRatio | *float64 | CW execution ratio |
IIndex | *float64 | I index |
INAV | *float64 | iNAV value |
OpenInterest | *float64 | Open interest (derivatives) |
SettlementPrice | *float64 | Settlement price (derivatives) |
StockType | *string | Stock type |
SecuritiesSummary
| Field | Type | Description |
|---|---|---|
Symbol | string | Stock symbol |
TradingDate | string | Trading date |
PriceChange | float64 | Price change |
PriceChangePercent | float64 | Price change (%) |
OpenPrice | float64 | Open price |
HighPrice | float64 | High price |
LowPrice | float64 | Low price |
ClosePrice | float64 | Close price |
AveragePrice | float64 | Average price |
TotalMatch | int | Total matched volume |
TotalMatchValue | float64 | Total matched value |
TotalBuy | int | Total buy volume |
TotalTradeBuy | float64 | Total buy value |
TotalSell | int | Total sell volume |
TotalTradeSell | float64 | Total sell value |
TotalForeignBuy / TotalForeignBuyValue | int / float64 | Foreign buy volume / value |
TotalForeignSell / TotalForeignSellValue | int / float64 | Foreign sell volume / value |
RemainForeignRoom / TotalForeignRoom | int | Remaining / total foreign room |
TotalDeal / TotalDealValue | int / float64 | Deal volume / value |
OpenInterest / SettlementPrice | float64 | Open interest / settlement price (derivatives) |
Ceiling / Floor / RefPrice | *float64 | Always nil here, because this endpoint does not send them. Use GetMasterData |
MasterData
Returned by GetMasterData() and GetMasterDataHistorical(from, to).
| Field | Type | Description |
|---|---|---|
Board | market.Board | Board (a raw string for a board the SDK does not know) |
Symbol | string | Symbol |
TradingDate | string | Trading date |
Ceiling | float64 | Ceiling price |
Floor | float64 | Floor price |
RefPrice | float64 | Reference price |
CorporateAction
Returned by GetCorporateActions(opts...) and GetCorporateActionsHistorical(from, to, opts...) (see 3.7. Corporate Actions). Every field is a string exactly as the server sends it; a blank, null or missing field is "".
| Field | Type | Description |
|---|---|---|
Symbol | string | Symbol |
EventTitle | string | Event title (in the requested language, "vn" or "en") |
ExrightDate | string | Ex-right date, text YYYY/MM/DD |
RecordDate | string | Record date, text YYYY/MM/DD |
IssueDate | string | Issue date, text YYYY/MM/DD |
Exchange | string | Exchange |
Ratio | string | Ratio, not parsed (its meaning depends on the event type) |
Portfolio
Methods that find nothing return nil (not an empty struct): the balance, PPMMR and derivative-position methods return a nil pointer, and GetEquityPositions returns a nil slice. Check for nil / len(...) == 0.
EquityAccountBalance
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
AccountBalance | float64 | Account balance (available cash) |
TotalDebt | float64 | Total debt |
InterestLoan | float64 | Loan interest |
OverdueFeeLoan | float64 | Overdue fee |
Withdrawable | float64 | Withdrawable amount |
OnHoldCash | float64 | On-hold cash |
SellUnmatched | float64 | Sell unmatched |
SellT0 | float64 | Sell T+0 |
SellT1 | float64 | Sell T+1 |
SellT2 | float64 | Sell T+2 |
BuyUnmatched | float64 | Buy unmatched |
BuyT0 | float64 | Buy T+0 |
BuyT1 | float64 | Buy T+1 |
BuyT2 | float64 | Buy T+2 |
AdvanceCashT0 | float64 | Advance cash T+0 |
AdvanceCashT1 | float64 | Advance cash T+1 |
HoldSubscription | float64 | Hold subscription |
Dividend | float64 | Dividend |
DerivativeAccountBalance
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
AccountBalance | float64 | Account balance |
Fee | float64 | Fee |
Commission | float64 | Commission |
Interest | float64 | Interest |
ExtInterest | float64 | Extended interest |
Loan | float64 | Loan |
DeliveryAmount | float64 | Delivery amount |
FloatingPL | float64 | Floating P&L |
TradingPL | float64 | Trading P&L |
TotalPL | float64 | Total P&L |
Withdrawable | float64 | Withdrawable amount |
CashSSI | float64 | Cash at SSI |
ValidNonCashSSI | float64 | Valid non-cash assets at SSI |
WithdrawableSSI | float64 | Withdrawable at SSI (was CashWithdrawableSSI before 3.3.0; the old name remains as a deprecated method) |
CashVSDC | float64 | Cash at VSDC |
ValidNonCashVSDC | float64 | Valid non-cash assets at VSDC |
WithdrawableVSDC | float64 | Withdrawable at VSDC (was CashWithdrawableVSDC before 3.3.0; the old name remains as a deprecated method) |
EquityPosition
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
Symbol | string | Stock symbol |
Quantity | int | Total quantity |
SellableQuantity | int | Sellable quantity |
CostPrice | float64 | Cost price |
BuyingQuantity | int | Buying quantity |
SellingQuantity | int | Selling quantity |
MortgageQuantity | int | Mortgage quantity |
BlockQuantity | int | Blocked quantity |
DividendQuantity | int | Dividend quantity |
BoughtQuantity | int | Bought quantity |
SoldQuantity | int | Sold quantity |
T1BuyQuantity | int | T+1 buy quantity |
T2BuyQuantity | int | T+2 buy quantity |
T1SellQuantity | int | T+1 sell quantity |
T2SellQuantity | int | T+2 sell quantity |
RestrictedQuantity | int | Restricted quantity |
DerivativePosition
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
Symbol | string | Contract symbol |
Long / Short / Net | int | Long / short / net position |
BidAvgPrice / AskAvgPrice | float64 | Avg buy / sell price |
FloatingPL / TradingPL | float64 | P&L |
TradePrice | float64 | Trade price |
Order
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
ClientRequestID | string | Client request ID |
OrderID | string | Order ID |
Symbol | string | Stock symbol |
Side | trading.OrderSide | Buy/Sell |
OrderType | trading.OrderType | Order type |
Price / AvgPrice | float64 | Order price / Avg fill price |
PriceText | string | Price as text (for example ATO, ATC) |
Quantity | int | Order quantity |
OSQuantity | *int | Outstanding quantity. nil for orders from the REST order book (the server does not send it there) |
FilledQuantity | int | Filled quantity |
CancelQuantity | int | Cancelled quantity |
Status | trading.OrderStatus | Order status |
InputTime / ModifyTime | string | Input / modify time, format yyyy/MM/dd HH:mm:ss |
Message | string | Message |
Trading Responses
PlaceOrderResponse
OrderID, ClientRequestID, Status (trading.OrderStatus)
ModifyOrderResponse
ClientModifyID, OrderID, ClientRequestID, Status
CancelOrderResponse
ClientCancelID, OrderID, ClientRequestID, Status
MaxBuySellResponse
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
Symbol | string | Symbol |
MaxBuyQuantity | int | Maximum buy quantity |
MaxSellQuantity | int | Maximum sell quantity |
MarginRatio | *string | Margin ratio. nil on derivative accounts |
PurchasingPower | *int | Purchasing power. nil on derivative accounts. The old PurchasePower() method is deprecated and returns a string |
Order options
PlaceOrder and the Place*Order helpers take opts ...trading.OrderOption; trading.WithClientRequestID(id) sets your own idempotency key (at most 20 characters). The FCO place and cancel methods take opts ...trading.FCOOption; trading.WithOTPCode(code) supplies the one-time code when the account requires one (optional).
Batch Orders
Types used by PlaceBatchOrders / CancelBatchOrders and by the Trading WebSocket batch methods. Methods, behaviour and examples: Batch Orders.
BatchPlaceOrderItem (one order to place)
The fields mirror the arguments of PlaceOrder.
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number (required) |
Symbol | string | Symbol (required) |
Side | trading.OrderSide | trading.OrderSideBuy ("B") or trading.OrderSideSell ("S") |
Quantity | int | Quantity, must be greater than 0 |
Price | float64 | Price (VND). Must be greater than 0 for LO and PLO; other order types are market-priced |
OrderType | trading.OrderType | ATO, ATC, LO, MTL, MP, MOK, MAK, PLO |
ClientRequestID | string | Idempotency key of the order, at most 20 characters. If empty, the SDK generates one |
BatchCancelOrderItem (one order to cancel)
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number (required) |
OrderID | string | Order ID issued by the server |
ClientRequestID | string | The ClientRequestID you used when placing the order |
Each cancel item needs exactly one of OrderID or ClientRequestID. With both, or neither, the SDK returns a *ValidationError.
BatchOrderResponse
| Field | Type | Description |
|---|---|---|
BatchRequestID | string | Batch ID, as returned by the server |
Results | []BatchOrderResult | One result per order. The SDK code comment says "in request order"; this is not confirmed by the server, so match results by ClientRequestID / OrderID if you need certainty |
If the server sends no results, or results is not a list, Results is an empty slice.
BatchOrderResult
| Field | Type | Description |
|---|---|---|
ClientRequestID | string | Idempotency key of the order |
OrderID | string | Order ID issued by the server |
Status | trading.OrderStatus | Order status (an unknown value is kept as a raw string) |
Success | bool | true if this order was accepted |
ErrorCode | string | Error code for this order only (when Success == false) |
ErrorMessage | string | Error message for this order only |
ClientCancelID | string | Cancel ID (clientCancelId) returned by the server, typically seen in CancelBatchOrders results |
BatchOrderRequest (wire body)
Built by the SDK; you normally do not create it. BatchRequestID (random string), BatchRequestTime (int64, epoch milliseconds) and Orders. The JSON body is {"batchRequestId", "batchRequestTime", "orders": [...]} and is signed as a whole.
Conditional Orders (FCO)
FCOPlaceResponse
Result of placing a conditional order — FCOID string
FCOCancelResponse
Result of cancelling a conditional order — FCOID string
FCOListResponse
Paginated list of conditional orders.
| Field | Type | Description |
|---|---|---|
PageIndex | int | Current page |
PageSize | int | Page size |
ItemsCount | int | Total record count |
PagesCount | int | Total page count. It can miss the last partial page: page until a page is empty, or compute from ItemsCount |
FCOList | []*FCOInfo | List of FCO orders |
FCOInfo
Detailed information of a single conditional order.
| Field | Type | Description |
|---|---|---|
FCOID | string | FCO order ID |
ClientID | string | Username / client ID |
AccountNo | string | Account number |
Quantity | int | Order quantity |
Price | string | Order price |
PriceSlip | *float64 | Price slip |
Symbol | string | Stock symbol |
Type | FCOType | Conditional order type |
FromDate | string | Effective start date |
ToDate | string | Effective end date |
MatchedQuantity | int | Matched quantity |
IsPlaceOrder | bool | Whether the underlying order has been placed |
Status | FCOStatus | FCO order status |
Detail | string | Status detail |
Params | *FCOParams | Trigger parameters. nil when the server sent none |
OrderType | OrderType | Underlying order type |
FCOParams
Trigger parameters of a conditional order.
| Field | Type | Description |
|---|---|---|
StopPrice | *float64 | Stop / trigger price |
Side | OrderSide | Order side (Buy/Sell) |
ActivePrice | *float64 | Trigger price (Trailing Stop) |
TrailingAmount | *float64 | Trailing amount |
TPActivePrice | *float64 | Take-profit trigger price |
SLActivePrice | *float64 | Stop-loss trigger price |
TPPrice | string | Take-profit price |
SLPrice | string | Stop-loss price |
TPSlip | *float64 | Take-profit slip |
SLSlip | *float64 | Stop-loss slip |
Operator | FCOOperator | Trigger comparison operator (the server may send a number 0-4; see ParseFCOOperator) |
FCOStatusHistoryItem
Returned by GetFcoStatusHistory(fcoID) as []FCOStatusHistoryItem. An empty history (HTTP 204) gives an empty list.
| Field | Type | Description |
|---|---|---|
State | string | State |
Time | string | Time of the transition |
Code | *string | Code, nil if the server sent none |
Detail | string | Detail |
FCOOrderBookResponse
Paginated FCO order book / execution log.
| Field | Type | Description |
|---|---|---|
PageIndex | int | Current page |
PageSize | int | Page size |
ItemsCount | int | Total record count |
PagesCount | int | Total page count |
OrderBook | []*FCOOrder | List of FCO order book entries |
FCOOrder
Execution log entry for an FCO order.
| Field | Type | Description |
|---|---|---|
FCOID | string | Parent FCO order ID |
AccountNo | string | Account number |
Quantity | int | Quantity |
Price | string | Order price |
Symbol | string | Stock symbol |
Side | OrderSide | Order side |
OrderType | OrderType | Underlying order type |
IsMainOrder | bool | Is the main order |
IsAttachedOrder | bool | Is an attached order |
CreatedTime / UpdatedTime | string | Created / updated time |
UniqueID | string | Unique ID |
OrderID | string | Exchange order ID |
MatchedQuantity | int | Matched quantity |
OSQuantity | int | Outstanding quantity |
AvgPrice | float64 | Average fill price |
Status | OrderStatus | Underlying order status |
Detail | string | Detail |
Type | FCOType | Conditional order type |
Streaming Messages
Received through SetOnData / SetOnTrading, or through the typed handlers (SetOnOrder, SetOnIndexSummary, ...). See Streaming.
TradeMessage
Type, TradingTime, Symbol, Price, Quantity, Side (string, "U" when the server gave none), TotalVolume, and the pointer fields Open, High, Low, Avg (*float64, nil when not sent).
QuoteMessage
Type, TradingTime, Symbol, BidPrices, BidVolumes, AskPrices, AskVolumes
ForeignRoomMessage
Type, TradingTime, Symbol, TotalRoom, CurrentRoom, BuyQuantity, BuyValue, SellQuantity, SellValue
PutMessage
Type, TradingTime, Symbol, Price (float64), Quantity, TotalQuantity, TotalValue (int)
OddLotMessage
Type, TradingTime, Symbol, Price, Quantity, BidPrices, BidVolumes, AskPrices, AskVolumes
MarketStatusMessage
Market, Status, TradingDate
MarketDataMessage
Reference / ceiling / floor data from a market.<symbol> topic (SubscribeMarket, alias SubscribeMasterData).
Symbol, Board, TradingTime, and the pointer fields Ceiling, Floor, RefPrice (*float64).
OrderStatusMessage
Order status event (order.<account>, eventType orderEvent).
| Field | Type |
|---|---|
Type, AccountNo, ClientRequestID, OrderID, Symbol | string / typed ids |
Side, OrderType, Status | typed (trading.OrderSide, OrderType, OrderStatus) |
Price | float64 |
PriceText, AvgPriceText | string |
AvgPrice | float64 |
Quantity, OSQuantity, FilledQuantity, CancelQuantity | numeric |
InputTime, ModifiedTime, Message | string |
RejectReason, ErrorCode, ErrorMessage | string |
SystemRequestID, NotifyID, ConnectionID | string |
Note the exact names: OSQuantity (not OsQuantity) and ModifiedTime (not ModifyTime).
OrderMatchMessage
Fill event (eventType orderMatchEvent; handler SetOnOrderMatch).
Type, NotifyID, ConnectionID, ClientRequestID, OrderID, Symbol, Side, AccountNo, MatchPrice (float64), MatchPriceText, MatchQty (int), MatchTime
PortfolioMessage
Position update, derivative accounts only (eventType clientPortfolioEvent; handler SetOnPortfolio).
| Field | Type | Description |
|---|---|---|
Type, AccountNo, Symbol, PositionType | string | Identification |
LongQty, ShortQty, Net, BidAvgPrice, AskAvgPrice, TradePrice, MarketPrice, FloatingPL, TradingPL | *float64 | Position values, nil when not sent |
TotalAsset, CashBalance, StockValue | *float64 | Always nil: the server never sends them. Do not rely on them |
FCOOrderUpdateMessage
Real-time conditional (FCO) order status update, received via SetOnTrading or SetOnOrder when EventType == "fcoEvent".
| Field | Type | Description |
|---|---|---|
FCOID | string | FCO order ID |
ProcessStatus | FCOStatus | FCO processing status (INIT, WAIT, WC, TER, ...) |
MatchedQuantity | int | Matched quantity |
IsPlaceOrder | bool | Whether the underlying order has been placed |
Symbol | string | Stock symbol |
Quantity | int | Order quantity |
Price | string | Order price |
AccountNo | string | Account number |
UpdatedTime | string | Update time |
Status | string | Status code |
Message | string | Detail message |
Username | string | Username that placed the order |
EventType | string | Event type ("fcoEvent") |
Type | trading.FCOType | Conditional order type (GTD, Stop, ...). The field is Type, not FCOType |
IntervalMessage
Candle for trade.<symbol>@1m|@5m and trade.index.<code>@1m|@5m.
| Field | Type | Description |
|---|---|---|
Type | stream.DataType | trade |
IntervalTime | string | Start time of the candle (key st) |
TradingTime | string | Trading time (key t) |
Symbol | string | Code |
Open | float64 | Open price |
High | float64 | High price |
Low | float64 | Low price |
Close | float64 | Close price |
Volume | int | Volume |
IndexTickMessage
Tick of the index itself (trade.index.<CODE>, also with the @tick suffix). See index subscriptions.
Not verified. The server sends abbreviated keys only; the meaning of each field was inferred by the SDK from the abbreviation, not confirmed by server documentation. If you need to be sure, read
Raw(a copy of the original object).
| Field | Type | Source key | Note (inferred) |
|---|---|---|---|
Type | stream.DataType | — | Always trade |
Symbol | string | s | Index code |
Board | string | b | Board |
Status | string | ss | Status |
TradingTime | string | t | Trading time |
Value | *float64 | v | Index value |
Change | *float64 | c | Change |
ChangePercent | *float64 | cr | Change in % |
Advances / Declines / NoChange | *float64 | adv / dec / nc | Number of symbols up / down / unchanged |
Ceilings / Floors | *float64 | ce / fl | Number of symbols at ceiling / floor |
TotalMatchValue / TotalMatchQuantity | *float64 | tmv / tmq | Total matched value / quantity |
TotalPutValue / TotalPutQuantity | *float64 | tvp / tqp | Total put-through value / quantity |
TotalQuantity / TotalValue | *float64 | tq / tv | Total quantity / value |
Raw | map[string]interface{} | — | The original object the server sent |
IndexSummaryMessage
Index summary (indexsummary.<CODE>; handler SetOnIndexSummary).
| Field / method | Type | Description |
|---|---|---|
Index | string | Index code, taken from the topic, upper-case |
Data | map[string]interface{} | The content the server sent, untouched. The public documentation does not list the fields, so the SDK does not guess |
Get(keys ...string) | interface{} | Returns the value of the first key present in Data, or nil |
MarketFlagMessage
Session flag (market.flag; handler SetOnMarketFlag).
| Field | Type | Description |
|---|---|---|
Board | string | HOSE, HNX, UPCOM or DER (derivatives), exactly as the server sends it |
TradingTime | string | Time |
Flag | string | Session flag (ATO, LO, ATC...) |
HeartbeatMessage
Method, Channel, Status, Message
ConnectionEvent
Package transport. Passed to SetOnConnection.
| Field | Type | Description |
|---|---|---|
State | string | "connected", "reconnected", "disconnected" or "failed" |
ReconnectCount | int | How many times the connection was re-established |
Err | error | Reason, when there is one |
Trading WebSocket Models
See Trading WebSocket. Order, FCO place and cancel calls reuse the REST types (PlaceOrderResponse, ModifyOrderResponse, CancelOrderResponse, FCOPlaceResponse, FCOCancelResponse, BatchPlaceOrderItem, BatchCancelOrderItem).
tradingws.Response
Returned by the batch, list and query methods.
| Field | Type | Description |
|---|---|---|
ID | string | Command id |
Method | string | Method name, for example query.orderBook |
Status | int | Status of the frame |
Result | interface{} | Result, usually a map[string]interface{} |
RateLimit | map[string]interface{} | Quota reported by the server (remaining, resetMs, ...) |
ReceivedTime | interface{} | Value of the frame's receivedTime key, if any |
tradingws.OrderBookQuery
| Field | Type | Description |
|---|---|---|
AccountNo | string | Account number |
FromDate / ToDate | string | Format YYYY/MM/DD, ToDate not before FromDate |
Symbol | string | Symbol |
OrderStatus | trading.OrderStatus | Filter by status |
PageIndex | int | Page, 1-based |
PageSize | int | Page size |
Empty or zero fields are omitted from the request.
Events from the socket arrive at Client().SetOnEvent(...) as map[string]interface{} frames with channel, topic and data (data.eventType: orderEvent, orderMatchEvent, clientPortfolioEvent).
Wrapper Types
AccountBalance
| Field | Type | Description |
|---|---|---|
Equity | *EquityAccountBalance | Equity account balance |
Derivative | *DerivativeAccountBalance | Derivative account balance |
Position
| Field | Type | Description |
|---|---|---|
Equity | []EquityPosition | Equity positions |
Derivative | *AllDerivativePosition | All derivative positions |
AllDerivativePosition
| Field | Type | Description |
|---|---|---|
OpenPositions | []DerivativePosition | Open positions |
ClosedPositions | []DerivativePosition | Closed positions |
AccountNo | string | Account number |
PPMMR
| Field | Type | Description |
|---|---|---|
Equity | *EquityPPMMR | Equity PPMMR |
Derivative | *DerivativePPMMR | Derivative PPMMR |