public class TradeContext extends Object implements AutoCloseable
| 构造器和说明 |
|---|
TradeContext(Config config) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
amendOrder(AmendOrderRequest request)
Amends an existing open order in the trading system.
|
void |
cancelOrder(CancelOrderRequest request)
Cancel a existing open orders in the trading system.
|
void |
close() |
Order |
createOrder(CreateOrderRequest request)
Create a new order
|
AccountSummaryReply |
getAccountSummary(String tradeAccountId)
Get a summary of the trading account,
|
Config |
getConfig() |
List<Position> |
getPosition(String tradeAccountId)
Query the position list of the trading account
|
List<Order> |
getTodayOrders(TodayOrderRequest request)
Get today orders
|
List<TradeAccount> |
listTradeAccounts()
Get a list of trading accounts
|
void |
setOnOrder(OrderHandler handler)
Set order callback
|
void |
subscribe(List<String> actionNameList)
Subscribe
|
void |
unsubscribe(List<String> actionNameList)
Unsubscribe
|
public TradeContext(Config config)
public void subscribe(List<String> actionNameList) throws OpenApiException
actionNameList - List of SubActionNameOpenApiException - If an error occurspublic void unsubscribe(List<String> actionNameList) throws OpenApiException
actionNameList - List of SubActionNameOpenApiException - If an error occurspublic void setOnOrder(OrderHandler handler)
handler - A order handlerpublic List<TradeAccount> listTradeAccounts() throws OpenApiException
TradeAccountOpenApiException - If an error occurspublic AccountSummaryReply getAccountSummary(String tradeAccountId) throws OpenApiException
tradeAccountId - The unique identifier of a trading accountAccountSummaryReplyOpenApiException - If an error occurspublic List<Position> getPosition(String tradeAccountId) throws OpenApiException
tradeAccountId - The unique identifier of a trading accountPositionOpenApiException - If an error occurspublic Order createOrder(CreateOrderRequest request) throws OpenApiException
request - parameters for this request,not nullOrderOpenApiException - If an error occurspublic void amendOrder(AmendOrderRequest request) throws OpenApiException
request - parameters for this request,not nullOpenApiException - If an error occurspublic void cancelOrder(CancelOrderRequest request) throws OpenApiException
request - parameters for this request,not nullOpenApiException - If an error occurspublic List<Order> getTodayOrders(TodayOrderRequest request) throws OpenApiException
request - parameters for this request,not nullOrderOpenApiException - If an error occurspublic Config getConfig()
public void close()
close 在接口中 AutoCloseableCopyright © 2025. All rights reserved.