public class QuoteContext extends Object implements AutoCloseable
| 构造器和说明 |
|---|
QuoteContext(Config config) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
BrokerQueue |
getBroker(String symbol)
Get security broker queue
|
Config |
getConfig() |
MarketDepth |
getDepth(String symbol)
Get market depth
|
List<Kbar> |
getHistoryKbar(String symbol,
int period,
int rehabType,
String beginTime,
String endTime)
Get security kbars
|
List<Kbar> |
getKbar(String symbol,
int period,
int rehabType,
int maxNum)
Get security kbars
|
List<MarketInfo> |
getMarketInfo()
Get all market states
|
List<ParticipantInfo> |
getParticipants()
Get participant IDs
|
List<SecurityQuote> |
getQuote(List<String> symbolList)
Get quote of securities
|
List<RealTimePrice> |
getRealTimePrice(List<String> symbolList)
Get real-time price of securities
|
List<SecurityCalcIndex> |
getSecurityCalcIndex(List<String> symbolList)
Get calculate index of securities
|
List<SecurityName> |
getSecurityList(String market,
boolean availableTrading) |
List<SecurityStaticInfo> |
getStaticInfo(List<String> symbolList)
Get static information of securities
|
SubscriptionInfoReply |
getSubscriptionInfo(boolean reqAllConn)
Get subscription information
|
List<TimeShare> |
getTimeShare(String symbol,
int section)
Get security timeshares
|
List<Trade> |
getTrade(String symbol)
Get security trades
|
void |
setOnBrokerQueue(BrokerQueueHandler handler)
Set broker queue callback
|
void |
setOnDepth(DepthHandler handler)
Set depth callback
|
void |
setOnQuote(QuoteHandler handler)
Set quote callback
|
void |
setOnTrade(TradeHandler handler)
Set trade callback
|
void |
subscribe(List<String> symbolList,
List<String> actionNameList,
boolean isFirstPush)
Subscribe
|
void |
unsubscribe(boolean unsubAll,
List<String> symbolList,
List<String> actionNameList)
Unubscribe
|
public QuoteContext(Config config)
public void subscribe(List<String> symbolList, List<String> actionNameList, boolean isFirstPush) throws OpenApiException
symbolList - Security symbolsactionNameList - List of SubActionNameisFirstPush - After subscription,Immediately push the latest data onceOpenApiException - If an error occurspublic void unsubscribe(boolean unsubAll,
List<String> symbolList,
List<String> actionNameList)
throws OpenApiException
unsubAll - One-click cancel all subscriptions currently connected, and ignore other parameters when it is set to truesymbolList - Security symbolsactionNameList - List of SubActionNameOpenApiException - If an error occurspublic SubscriptionInfoReply getSubscriptionInfo(boolean reqAllConn) throws OpenApiException
reqAllConn - Whether to return the subscription information of all connections.SubscriptionInfoReplyOpenApiException - If an error occurspublic void setOnQuote(QuoteHandler handler)
handler - A quote handlerpublic void setOnDepth(DepthHandler handler)
handler - A depth handlerpublic void setOnBrokerQueue(BrokerQueueHandler handler)
handler - A broker queue handlerpublic void setOnTrade(TradeHandler handler)
handler - A trade handlerpublic List<SecurityStaticInfo> getStaticInfo(List<String> symbolList) throws OpenApiException
symbolList - Security symbolsSecurityStaticInfoOpenApiException - If an error occurspublic List<SecurityQuote> getQuote(List<String> symbolList) throws OpenApiException
symbolList - Security symbolsSecurityQuoteOpenApiException - If an error occurspublic List<Trade> getTrade(String symbol) throws OpenApiException
symbol - Security symbolTradeOpenApiException - If an error occurspublic MarketDepth getDepth(String symbol) throws OpenApiException
symbol - Security symbolMarketDepthOpenApiException - If an error occurspublic BrokerQueue getBroker(String symbol) throws OpenApiException
symbol - Security symbolBrokerQueueOpenApiException - If an error occurspublic List<ParticipantInfo> getParticipants() throws OpenApiException
ParticipantInfoOpenApiException - If an error occurspublic List<TimeShare> getTimeShare(String symbol, int section) throws OpenApiException
symbol - Security symbolsection - Constants.SectionType section typeTimeShareOpenApiException - If an error occurspublic List<Kbar> getKbar(String symbol, int period, int rehabType, int maxNum) throws OpenApiException
symbol - Security symbolperiod - Constants.KbarPeriod period of kbarrehabType - Constants.RehabType types of adjustmentmaxNum - The number of kbar requestedKbarOpenApiException - If an error occurspublic List<Kbar> getHistoryKbar(String symbol, int period, int rehabType, String beginTime, String endTime) throws OpenApiException
symbol - Security symbolperiod - Constants.KbarPeriod period of kbarrehabType - Constants.RehabType types of adjustmentbeginTime - begin time (Format: yyyy-MM-dd)endTime - end time (Format: yyyy-MM-dd)KbarOpenApiException - If an error occurspublic List<MarketInfo> getMarketInfo() throws OpenApiException
MarketInfoOpenApiException - If an error occurspublic List<SecurityCalcIndex> getSecurityCalcIndex(List<String> symbolList) throws OpenApiException
symbolList - Security symbolsSecurityCalcIndexOpenApiException - If an error occurspublic List<RealTimePrice> getRealTimePrice(List<String> symbolList) throws OpenApiException
symbolList - Security symbolsRealTimePriceOpenApiException - If an error occurspublic List<SecurityName> getSecurityList(String market, boolean availableTrading) throws OpenApiException
OpenApiExceptionpublic Config getConfig()
public void close()
close 在接口中 AutoCloseableCopyright © 2025. All rights reserved.