Order Operations

Place Order

Purpose

Submits an order to the configured trading account.

Signature

func (c *TradeClient) PlaceOrder(order model.OrderRequest) (*model.PlaceOrderResult, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrderRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoReplaced with the client accountTrading account ID
IDint64NoOmitted when zeroNot used by placement; PlaceOrder does not overwrite it
OrderIdint64NoOmitted when zeroAccount-level order ID
ActionstringYesOmitted if emptyAllowed values: BUY, SELL
OrderTypestringYesOmitted if emptyAllowed values: MKT, LMT, STP, STP_LMT, TRAIL, AM, AL, TWAP, VWAP, OCA, ICEBERG
TotalQuantityint64ConditionalOmitted when zeroRequired for quantity-based orders; amount-based orders use Amount
LimitPricefloat64ConditionalOmitted when zeroRequired for limit-price order types
AuxPricefloat64ConditionalOmitted when zeroAuxiliary price for stop order types
TrailingPercentfloat64NoOmitted when zeroTrailing-stop percentage
TimeInForcestringNoOmitted if emptyAllowed values: DAY, GTC, OPG
OutsideRthboolNoOmitted when falseWhether to allow execution outside regular trading hours
OrderLegs[]OrderLegRequestNoOmitted if emptyAttached profit-taker or stop-loss orders
AlgoParams*AlgoParamsRequestNoOmitted when nilAlgorithm-order parameters
SymbolstringConditionalOmitted if emptyRequired for ordinary orders; multi-leg orders identify each leg through ContractLegs
SecTypestringYesOmitted if emptyAllowed values: STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
CurrencystringNoOmitted if emptyAllowed values: ALL, USD, HKD, CNH, SGD
ExpirystringNoOmitted if emptyOption or futures expiry
StrikestringNoOmitted if emptyOption strike price
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
IdentifierstringNoOmitted if emptyContract identifier
RemarkstringNoOmitted if emptyOrder remark
UserMarkstringNoOmitted if emptyUser mark
SecretKeystringNoUses the client configuration when emptyInstitutional-account authentication key
DisplaySizeint64NoOmitted when zeroIceberg display size
MinDisplaySizeint64NoOmitted if emptyDefaults to DisplaySize for iceberg orders
CheckIntervalsint64NoOmitted if emptyDefaults to 30 seconds for iceberg orders
PriceTypestringNoOmitted if emptyAllowed: LIMIT_PRICE, ASK_PRICE, BID_PRICE, LATEST_PRICE; iceberg default is LIMIT_PRICE
StartTimeint64NoOmitted when zeroIceberg effective start time in milliseconds
EndTimeint64NoOmitted when zeroIceberg effective end time in milliseconds
ExpireTimeint64NoOmitted when zeroGTD expiry time in milliseconds
AfterHoursPricefloat64NoOmitted when zeroAfter-hours order price
BatchNoint64NoOmitted when zeroBatch number
SegTypestringNoOmitted if emptyFunding segment type
Amountfloat64NoOmitted when zeroOrder amount for amount-based orders
IsQuantityByAmount*boolNoOmitted when nilDeprecated; new code sets Amount directly
AllocAccounts[]stringNoOmitted if emptyInstitutional account allocation list
AllocShares[]float64NoOmitted if emptyAllocation shares corresponding by index to AllocAccounts
SourcestringNoOmitted if emptyOrder source
ChannelstringNoOmitted if emptyOrder channel
VirtualOrderTypestringNoOmitted if emptyVirtual order type
VirtualIdstringNoOmitted if emptyVirtual order ID
ProfitTakerOrderIdint64NoOmitted when zeroProfit-taker order ID
StopLossOrderIdint64NoOmitted when zeroStop-loss order ID
LocalNostringNoOmitted if emptyLocal reference number
OcaOrders[]*OrderRequestNoOmitted if emptyOCA order group
ContractLegs[]ContractLegRequestNoOmitted if emptyMulti-leg option legs
ComboTypestringNoOmitted if emptyCombo type
OrderLegRequest fieldTypeDescription
LegTypestringAttached-order type (PROFIT/LOSS)
Pricefloat64Attached-order price
TimeInForcestringTime in force
Quantityint64Quantity
AlgoParamsRequest fieldTypeDescription
AlgoStrategystringAlgorithm strategy (TWAP/VWAP)
StartTimestringStart time
EndTimestringEnd time
ParticipationRatefloat64Participation rate
ContractLegRequest fieldTypeDescription
SymbolstringInstrument symbol
SecTypestringSecurity type
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
ActionstringTrade direction
Ratio*intNullable leg ratio

Returns

(*model.PlaceOrderResult, error). Key fields from model.PlaceOrderResult:

FieldTypeDescription
IDint64Order ID
OrderIDint64Order number
SubIDs[]int64Sub-order ID list
Orders[]OrderOrder list
Order field in OrdersTypeDescription
AccountstringAccount ID
IDint64Global order ID
OrderIdint64Account-level order number
ActionstringTrade direction
OrderTypestringOrder type
TotalQuantityint64Order quantity
LimitPricefloat64Limit price
AuxPricefloat64Auxiliary price
TrailingPercentfloat64Trailing-stop percentage
StatusstringOrder status
FilledQuantityint64Filled quantity
AvgFillPricefloat64Average fill price
TimeInForcestringTime in force
OutsideRthboolWhether execution outside regular hours is allowed
OrderLegs[]OrderLegAttached orders
AlgoParams*AlgoParamsAlgorithm parameters
SymbolstringInstrument symbol
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
IdentifierstringContract identifier
NamestringContract name
Commissionfloat64Commission
RealizedPnlfloat64Realized P&L
OpenTimeint64Open time in milliseconds
UpdateTimeint64Update time in milliseconds
LatestTimeint64Latest time in milliseconds
RemarkstringRemark
SourcestringOrder source
UserMarkstringUser mark
ExternalIdstringExternal ID
TotalQuantityScaleintOrder quantity scale
FilledQuantityScaleintFilled quantity scale
FilledCashAmountfloat64Filled cash amount
Gstfloat64GST
LiquidationboolWhether this is a liquidation order
AttrDescstringAttribute description
AttrList[]stringAttribute list
AlgoStrategystringAlgorithm strategy
Discountfloat64Discount
ReplaceStatusstringReplacement status
CancelStatusstringCancellation status
CanModifyboolWhether the order can be modified
CanCancelboolWhether the order can be cancelled
IsOpenboolWhether the order is open
OrderDiscountfloat64Order discount
TradingSessionTypestringTrading session type
LatestPricefloat64Latest price
DisplaySizeint64Iceberg display size
MinDisplaySizeint64Iceberg minimum display size
CheckIntervalsint64Iceberg price-check interval in seconds
PriceTypestringIceberg price type
StartTimeint64Effective start time in milliseconds
EndTimeint64Effective end time in milliseconds
OrderLeg field in OrderLegsTypeDescription
LegTypestringAttached-order type
Pricefloat64Price
TimeInForcestringTime in force
Quantityint64Quantity
AlgoParams fieldTypeDescription
AlgoStrategystringAlgorithm strategy
StartTimestringStart time
EndTimestringEnd time
ParticipationRatefloat64Participation rate

The returned order ID confirms only that the placement request was submitted. Continue querying the order to determine its final status.

Invocation example

result, err := tc.PlaceOrder(model.OrderRequest{
	Account: "U123456",
	Symbol: "AAPL",
	SecType: "STK",
	Action: "BUY",
	OrderType: "LMT",
	TotalQuantity: 1,
	LimitPrice: 310.00,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "id": 123456789,
  "order_id": 100001,
  "subIds": [123456790],
  "orders": [
    {
      "id": 123456789,
      "orderId": 100001,
      "account": "U123456",
      "symbol": "AAPL",
      "secType": "STK",
      "action": "BUY",
      "orderType": "LMT",
      "limitPrice": 310.00,
      "totalQuantity": 1,
      "filledQuantity": 0,
      "status": "Initial"
    }
  ]
}

Rate limit

The base rate limit is 120 requests/min.


Preview Order

Purpose

Validates an order and estimates commission and margin without placing it.

Signature

func (c *TradeClient) PreviewOrder(order model.OrderRequest) (*model.PreviewResult, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrderRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoReplaced with the client accountTrading account ID
IDint64NoOmitted when zeroNot used by preview
OrderIdint64NoOmitted when zeroAccount-level order ID
ActionstringYesOmitted if emptyAllowed values: BUY, SELL
OrderTypestringYesOmitted if emptyAllowed values: MKT, LMT, STP, STP_LMT, TRAIL, AM, AL, TWAP, VWAP, OCA, ICEBERG
TotalQuantityint64ConditionalOmitted when zeroRequired for quantity-based previews; amount-based previews use Amount
LimitPricefloat64ConditionalOmitted when zeroRequired for limit-price order types
AuxPricefloat64ConditionalOmitted when zeroAuxiliary price for stop order types
TrailingPercentfloat64NoOmitted when zeroTrailing-stop percentage
TimeInForcestringNoOmitted if emptyAllowed values: DAY, GTC, OPG
OutsideRthboolNoOmitted when falseWhether to allow execution outside regular trading hours
OrderLegs[]OrderLegRequestNoOmitted if emptyAttached profit-taker or stop-loss orders
AlgoParams*AlgoParamsRequestNoOmitted when nilAlgorithm-order parameters
SymbolstringConditionalOmitted if emptyRequired for ordinary orders; multi-leg orders identify each leg through ContractLegs
SecTypestringYesOmitted if emptyAllowed values: STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
CurrencystringNoOmitted if emptyAllowed values: ALL, USD, HKD, CNH, SGD
ExpirystringNoOmitted if emptyOption or futures expiry
StrikestringNoOmitted if emptyOption strike price
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
IdentifierstringNoOmitted if emptyContract identifier
RemarkstringNoOmitted if emptyOrder remark
UserMarkstringNoOmitted if emptyUser mark
SecretKeystringNoUses the client configuration when emptyInstitutional-account authentication key
DisplaySizeint64NoOmitted when zeroIceberg display size
MinDisplaySizeint64NoOmitted if emptyDefaults to DisplaySize for iceberg orders
CheckIntervalsint64NoOmitted if emptyDefaults to 30 seconds for iceberg orders
PriceTypestringNoOmitted if emptyAllowed: LIMIT_PRICE, ASK_PRICE, BID_PRICE, LATEST_PRICE; iceberg default is LIMIT_PRICE
StartTimeint64NoOmitted when zeroIceberg effective start time in milliseconds
EndTimeint64NoOmitted when zeroIceberg effective end time in milliseconds
ExpireTimeint64NoOmitted when zeroGTD expiry time in milliseconds
AfterHoursPricefloat64NoOmitted when zeroAfter-hours order price
BatchNoint64NoOmitted when zeroBatch number
SegTypestringNoOmitted if emptyFunding segment type
Amountfloat64NoOmitted when zeroOrder amount for amount-based orders
IsQuantityByAmount*boolNoOmitted when nilDeprecated; new code sets Amount directly
AllocAccounts[]stringNoOmitted if emptyInstitutional account allocation list
AllocShares[]float64NoOmitted if emptyAllocation shares corresponding by index to AllocAccounts
SourcestringNoOmitted if emptyOrder source
ChannelstringNoOmitted if emptyOrder channel
VirtualOrderTypestringNoOmitted if emptyVirtual order type
VirtualIdstringNoOmitted if emptyVirtual order ID
ProfitTakerOrderIdint64NoOmitted when zeroProfit-taker order ID
StopLossOrderIdint64NoOmitted when zeroStop-loss order ID
LocalNostringNoOmitted if emptyLocal reference number
OcaOrders[]*OrderRequestNoOmitted if emptyOCA order group
ContractLegs[]ContractLegRequestNoOmitted if emptyMulti-leg option legs
ComboTypestringNoOmitted if emptyCombo type

OrderLegRequest fields

FieldTypeRequiredDefault/omissionDescription
LegTypestringNoOmitted when emptyAttached-order type
Pricefloat64NoOmitted when zeroAttached-order price
TimeInForcestringNoOmitted when emptyTime in force
Quantityint64NoOmitted when zeroQuantity

AlgoParamsRequest fields

FieldTypeRequiredDefault/omissionDescription
AlgoStrategystringNoOmitted when emptyAlgorithm strategy
StartTimestringNoOmitted when emptyAlgorithm-order start time
EndTimestringNoOmitted when emptyAlgorithm-order end time
ParticipationRatefloat64NoOmitted when zeroParticipation rate

ContractLegRequest fields

FieldTypeRequiredDefault/omissionDescription
SymbolstringNoOmitted when emptyInstrument symbol
SecTypestringNoOmitted when emptySecurity type
ExpirystringNoOmitted when emptyExpiry date
StrikestringNoOmitted when emptyStrike price
RightstringNoOmitted when emptyOption side
ActionstringNoOmitted when emptyTrade direction
Ratio*intNoOmitted when nilMulti-leg ratio

Each OcaOrders entry uses the OrderRequest model above; the same fields are not repeated.

Returns

(*model.PreviewResult, error). Key fields from model.PreviewResult:

FieldTypeDescription
AccountstringAccount ID
IsPassboolWhether risk check passed
Commissionfloat64Estimated commission
CommissionCurrencystringCommission currency
MarginCurrencystringMargin currency
InitMarginfloat64Initial margin (after order)
InitMarginBeforefloat64Initial margin (before order)
MaintMarginfloat64Maintenance margin (after order)
MaintMarginBeforefloat64Maintenance margin (before order)
EquityWithLoanfloat64Equity with loan (after order)
EquityWithLoanBeforefloat64Equity with loan (before order)
AvailableEEfloat64Available excess equity after the hypothetical fill, in MarginCurrency
ExcessLiquidityfloat64Excess liquidity after the hypothetical fill, in MarginCurrency
OvernightLiquidationfloat64Overnight excess liquidity after the hypothetical fill, in MarginCurrency
Gstfloat64GST
MessagestringPreview-result message

These fields may be absent for account types or scenarios where they do not apply. The Go model uses non-pointer float64 fields, so a missing value and an explicit zero both appear as 0.

Invocation example

result, err := tc.PreviewOrder(model.OrderRequest{
	Account: "U123456",
	Symbol: "AAPL",
	SecType: "STK",
	Action: "BUY",
	OrderType: "LMT",
	TotalQuantity: 1,
	LimitPrice: 310.00,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "account": "U123456",
  "isPass": true,
  "commission": 0.99,
  "commissionCurrency": "USD",
  "marginCurrency": "USD",
  "initMargin": 31000.00,
  "initMarginBefore": 30000.00,
  "maintMargin": 28000.00,
  "maintMarginBefore": 27000.00,
  "equityWithLoan": 100000.00,
  "equityWithLoanBefore": 100500.00,
  "availableEE": 69000.00,
  "excessLiquidity": 72000.00,
  "overnightLiquidation": 71000.00,
  "gst": 0.00,
  "message": ""
}

Modify Order

Purpose

Changes an existing order identified by its global ID.

Signature

func (c *TradeClient) ModifyOrder(id int64, order model.OrderRequest) (*model.OrderIDResult, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrderRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoReplaced with the client accountTrading account ID
IDint64NoSet from the id argumentDo not set it again in order; the struct field is overwritten
OrderIdint64NoOmitted when zeroAccount-level order ID
ActionstringNoOmitted if emptyAllowed values: BUY, SELL
OrderTypestringNoOmitted if emptyAllowed values: MKT, LMT, STP, STP_LMT, TRAIL, AM, AL, TWAP, VWAP, OCA, ICEBERG
TotalQuantityint64NoOmitted when zeroReplacement total quantity
LimitPricefloat64NoOmitted when zeroReplacement limit price
AuxPricefloat64NoOmitted when zeroReplacement auxiliary or stop price
TrailingPercentfloat64NoOmitted when zeroReplacement trailing-stop percentage
TimeInForcestringNoOmitted if emptyAllowed values: DAY, GTC, OPG
OutsideRthboolNoOmitted when falseWhether to allow execution outside regular trading hours
OrderLegs[]OrderLegRequestNoOmitted if emptyAttached profit-taker or stop-loss orders
AlgoParams*AlgoParamsRequestNoOmitted when nilAlgorithm-order parameters
SymbolstringNoOmitted if emptyInstrument symbol
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
CurrencystringNoOmitted if emptyAllowed values: ALL, USD, HKD, CNH, SGD
ExpirystringNoOmitted if emptyOption or futures expiry
StrikestringNoOmitted if emptyOption strike price
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
IdentifierstringNoOmitted if emptyContract identifier
RemarkstringNoOmitted if emptyOrder remark
UserMarkstringNoOmitted if emptyUser mark
SecretKeystringNoUses the client configuration when emptyInstitutional-account authentication key
DisplaySizeint64NoOmitted when zeroIceberg display size
MinDisplaySizeint64NoOmitted if emptyDefaults to DisplaySize for iceberg orders
CheckIntervalsint64NoOmitted if emptyDefaults to 30 seconds for iceberg orders
PriceTypestringNoOmitted if emptyAllowed: LIMIT_PRICE, ASK_PRICE, BID_PRICE, LATEST_PRICE; iceberg default is LIMIT_PRICE
StartTimeint64NoOmitted when zeroIceberg effective start time in milliseconds
EndTimeint64NoOmitted when zeroIceberg effective end time in milliseconds
ExpireTimeint64NoOmitted when zeroGTD expiry time in milliseconds
AfterHoursPricefloat64NoOmitted when zeroAfter-hours order price
BatchNoint64NoOmitted when zeroBatch number
SegTypestringNoOmitted if emptyFunding segment type
Amountfloat64NoOmitted when zeroOrder amount for amount-based orders
IsQuantityByAmount*boolNoOmitted when nilDeprecated; new code sets Amount directly
AllocAccounts[]stringNoOmitted if emptyInstitutional account allocation list
AllocShares[]float64NoOmitted if emptyAllocation shares corresponding by index to AllocAccounts
SourcestringNoOmitted if emptyOrder source
ChannelstringNoOmitted if emptyOrder channel
VirtualOrderTypestringNoOmitted if emptyVirtual order type
VirtualIdstringNoOmitted if emptyVirtual order ID
ProfitTakerOrderIdint64NoOmitted when zeroProfit-taker order ID
StopLossOrderIdint64NoOmitted when zeroStop-loss order ID
LocalNostringNoOmitted if emptyLocal reference number
OcaOrders[]*OrderRequestNoOmitted if emptyOCA order group
ContractLegs[]ContractLegRequestNoOmitted if emptyMulti-leg option legs
ComboTypestringNoOmitted if emptyCombo type
idint64YesNone; zero values are serializedId value

OrderLegRequest fields

FieldTypeRequiredDefault/omissionDescription
LegTypestringNoOmitted when emptyAttached-order type
Pricefloat64NoOmitted when zeroAttached-order price
TimeInForcestringNoOmitted when emptyTime in force
Quantityint64NoOmitted when zeroQuantity

AlgoParamsRequest fields

FieldTypeRequiredDefault/omissionDescription
AlgoStrategystringNoOmitted when emptyAlgorithm strategy
StartTimestringNoOmitted when emptyAlgorithm-order start time
EndTimestringNoOmitted when emptyAlgorithm-order end time
ParticipationRatefloat64NoOmitted when zeroParticipation rate

ContractLegRequest fields

FieldTypeRequiredDefault/omissionDescription
SymbolstringNoOmitted when emptyInstrument symbol
SecTypestringNoOmitted when emptySecurity type
ExpirystringNoOmitted when emptyExpiry date
StrikestringNoOmitted when emptyStrike price
RightstringNoOmitted when emptyOption side
ActionstringNoOmitted when emptyTrade direction
Ratio*intNoOmitted when nilMulti-leg ratio

Each OcaOrders entry uses the OrderRequest model above; the same fields are not repeated.

Returns

(*model.OrderIDResult, error). Key fields from model.OrderIDResult:

FieldTypeDescription
IDint64Order ID

The returned order ID confirms only that the modification request was submitted, not that the replacement values are effective. Continue querying until the new values appear or the order reaches a final status.

Invocation example

result, err := tc.ModifyOrder(123456789, model.OrderRequest{
	Account: "U123456",
	ID: 1,
	Action: "BUY",
	OrderType: "LMT",
	TotalQuantity: 1,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "id": 123456789
}

Rate limit

The base rate limit is 120 requests/min.


Cancel Order

Purpose

Cancels an existing order identified by its global ID.

Signature

func (c *TradeClient) CancelOrder(id int64) (*model.OrderIDResult, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

ParameterTypeRequiredSDK defaultConstraints
idint64YesNoneGlobal order ID

Returns

(*model.OrderIDResult, error). Key fields from model.OrderIDResult:

FieldTypeDescription
IDint64Order ID

The returned order ID confirms only that the cancellation request was submitted. Continue querying until Status is Cancelled or the order reaches another final state, such as a fill that completed first; request acceptance is not cancellation completion.

Invocation example

result, err := tc.CancelOrder(123456789)
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "id": 123456789
}

Rate limit

The base rate limit is 120 requests/min.


Estimate Tradable Quantity

Purpose

Estimates cash-buy, margin-buy, short-sell, and position-sell quantities. The client fills an empty account field from the client default.

Signature

func (c *TradeClient) EstimateTradableQuantity(req model.EstimateTradableQuantityRequest) (*model.EstimateTradableQuantity, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.EstimateTradableQuantityRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses the client configuration when emptyInstitutional-account authentication key
SymbolstringYesOmitted if emptyInstrument symbol
SecTypestringYesOmitted if emptySecurity type; allowed values: STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
ActionstringYesOmitted if emptyTrade direction; allowed values: BUY, SELL
OrderTypestringNoOmitted if emptyAllowed values: MKT, LMT, STP, STP_LMT, TRAIL, AM, AL, TWAP, VWAP, OCA, ICEBERG
LimitPricefloat64ConditionalOmitted when zeroPrice for limit-price order types
StopPricefloat64ConditionalOmitted when zeroTrigger price for stop order types
ExpirystringConditionalOmitted if emptyOption or futures expiry
StrikestringConditionalOmitted if emptyOption strike price
RightstringConditionalOmitted if emptyOption side; allowed values: PUT, CALL
SegTypestringNoOmitted if emptyFunding segment; allowed values: ALL, SEC, FUT, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

(*model.EstimateTradableQuantity, error). Key fields from model.EstimateTradableQuantity:

FieldTypeDescription
TradableQuantityfloat64Tradable quantity
MaxCashBuyQuantityfloat64Max cash buy quantity
MaxMarginBuyQuantityfloat64Max margin buy quantity
MaxShortSellQuantityfloat64Max short sell quantity
MaxPositionSellQuantityfloat64Max position sell quantity
CashBuyingPowerfloat64Cash buying power
CurrencystringCurrency

Invocation example

result, err := tc.EstimateTradableQuantity(model.EstimateTradableQuantityRequest{
	Account: "U123456",
	Symbol: "AAPL",
	SecType: "STK",
	Action: "BUY",
	OrderType: "MKT",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "tradableQuantity": 320,
  "maxCashBuyQuantity": 100,
  "maxMarginBuyQuantity": 320,
  "maxShortSellQuantity": 0,
  "maxPositionSellQuantity": 0,
  "cashBuyingPower": 31000.00,
  "currency": "USD"
}

Rate limit

The base rate limit is 60 requests/min.



Did this page help you?