Documentation
¶
Index ¶
- Constants
- Variables
- func BrokerHostAddresses() []string
- func DefaultMACBoardMembersQuotesFieldBitmap() [20]byte
- func ExHostAddresses() []string
- func FullMACBoardMembersQuotesFieldBitmap() [20]byte
- func MACBoardMembersQuotesFieldBitmapFromBits(bits ...int) [20]byte
- func MACExHostAddresses() []string
- func MACHostAddresses() []string
- func MainHostAddresses() []string
- type BlockFlatItem
- type BlockGroup
- type Client
- func (client *Client) Connect() (*proto.Hello1Reply, error)
- func (client *Client) ConnectEx() (*proto.ExLoginReply, error)
- func (client *Client) ConnectMAC() error
- func (client *Client) CurrentAddress() string
- func (client *Client) Disconnect() error
- func (client *Client) DownloadFile(filename string, start uint32, size uint32) (*proto.DownloadFileReply, error)
- func (client *Client) DownloadFullFile(filename string, size uint32) ([]byte, error)
- func (client *Client) ExBoardList(boardType uint16, start uint16, pageSize uint16) ([]proto.ExBoardListItem, error)
- func (client *Client) ExCategoryList() ([]proto.ExCategoryItem, error)
- func (client *Client) ExChartSampling(category uint8, code string) ([]float64, error)
- func (client *Client) ExCount() (uint32, error)
- func (client *Client) ExDownloadFile(filename string, start uint32, size uint32) (*proto.DownloadFileReply, error)
- func (client *Client) ExDownloadFullFile(filename string, size uint32) ([]byte, error)
- func (client *Client) ExExperiment2487(category uint8, code string) (*proto.ExExperiment2487Reply, error)
- func (client *Client) ExExperiment2488(category uint8, code string, mode uint16) ([]proto.ExExperiment2488Item, error)
- func (client *Client) ExGetBoardList(boardType uint16, start uint16, pageSize uint16) (*proto.ExGetBoardListReply, error)
- func (client *Client) ExGetCategoryList() (*proto.ExGetCategoryListReply, error)
- func (client *Client) ExGetChartSampling(category uint8, code string) (*proto.ExGetChartSamplingReply, error)
- func (client *Client) ExGetCount() (*proto.ExGetCountReply, error)
- func (client *Client) ExGetExperiment2487(category uint8, code string) (*proto.ExExperiment2487Reply, error)
- func (client *Client) ExGetExperiment2488(category uint8, code string, mode uint16) (*proto.ExExperiment2488Reply, error)
- func (client *Client) ExGetFileMeta(filename string) (*proto.GetFileMetaReply, error)
- func (client *Client) ExGetHistoryTickChart(date uint32, category uint8, code string) (*proto.ExGetHistoryTickChartReply, error)
- func (client *Client) ExGetHistoryTransaction(date uint32, category uint8, code string) (*proto.ExGetHistoryTransactionReply, error)
- func (client *Client) ExGetKLine(category uint8, code string, period uint16, start uint32, count uint16, ...) (*proto.ExGetKLineReply, error)
- func (client *Client) ExGetKLine2(category uint8, code string, period uint16, start uint32, count uint32, ...) (*proto.ExGetKLine2Reply, error)
- func (client *Client) ExGetList(start uint32, count uint16) (*proto.ExGetListReply, error)
- func (client *Client) ExGetListExtra(a uint16, b uint16, count uint16) (*proto.ExGetListExtraReply, error)
- func (client *Client) ExGetMapping2562(market uint16, start uint32, count uint32) (*proto.ExMapping2562Reply, error)
- func (client *Client) ExGetQuote(category uint8, code string) (*proto.ExGetQuoteReply, error)
- func (client *Client) ExGetQuotes(categories []uint8, codes []string) (*proto.ExGetQuotesReply, error)
- func (client *Client) ExGetQuotes2(categories []uint8, codes []string) (*proto.ExGetQuotesReply, error)
- func (client *Client) ExGetQuotesList(category uint8, start uint16, count uint16, sortType uint16, reverse bool) (*proto.ExGetQuotesListReply, error)
- func (client *Client) ExGetTable() (string, error)
- func (client *Client) ExGetTableDetail() (string, error)
- func (client *Client) ExGetTickChart(category uint8, code string) (*proto.ExGetTickChartReply, error)
- func (client *Client) ExHistoryTransaction(date uint32, category uint8, code string) ([]proto.ExHistoryTransactionItem, error)
- func (client *Client) ExKLine(category uint8, code string, period uint16, start uint32, count uint16, ...) ([]proto.ExKLineItem, error)
- func (client *Client) ExKLine2(category uint8, code string, period uint16, start uint32, count uint32, ...) ([]proto.ExKLineItem, error)
- func (client *Client) ExList(start uint32, count uint16) ([]proto.ExListItem, error)
- func (client *Client) ExListExtra(a uint16, b uint16, count uint16) ([]proto.ExExtraListItem, error)
- func (client *Client) ExMapping2562(market uint16, start uint32, count uint32) ([]proto.ExMapping2562Item, error)
- func (client *Client) ExQuote(category uint8, code string) (*proto.ExQuoteItem, error)
- func (client *Client) ExQuotes(categories []uint8, codes []string) ([]proto.ExQuoteItem, error)
- func (client *Client) ExQuotes2(categories []uint8, codes []string) ([]proto.ExQuoteItem, error)
- func (client *Client) ExQuotesList(category uint8, start uint16, count uint16, sortType uint16, reverse bool) ([]proto.ExQuoteItem, error)
- func (client *Client) ExTable() (string, error)
- func (client *Client) ExTableDetail() (string, error)
- func (client *Client) ExTickChart(category uint8, code string, date uint32) ([]proto.ExTickChartData, error)
- func (client *Client) FastestHost() (HostProbeResult, error)
- func (client *Client) GetAnnouncement() (*proto.AnnouncementReply, error)
- func (client *Client) GetAuction(market uint8, code string, start uint32, count uint32) (*proto.GetAuctionReply, error)
- func (client *Client) GetBlockFile(filename string) ([]byte, error)
- func (client *Client) GetCSVFile(filename string) ([][]string, error)
- func (client *Client) GetChartSampling(market uint8, code string) (*proto.GetChartSamplingReply, error)
- func (client *Client) GetClient26AC() (*proto.RawDataReply, error)
- func (client *Client) GetClient26AD() (*proto.RawDataReply, error)
- func (client *Client) GetClient26AE() (*proto.RawDataReply, error)
- func (client *Client) GetClient26B1() (*proto.RawDataReply, error)
- func (client *Client) GetClient264B() (*proto.RawDataReply, error)
- func (client *Client) GetCompanyCategories(market uint8, code string) (*proto.GetCompanyCategoryReply, error)
- func (client *Client) GetCompanyContent(market uint8, code string, filename string, start uint32, length uint32) (*proto.GetCompanyContentReply, error)
- func (client *Client) GetCompanyInfo(market uint8, code string) (*CompanyInfoBundle, error)
- func (client *Client) GetExServerInfo() (*proto.ExServerInfoReply, error)
- func (client *Client) GetExchangeAnnouncement() (*proto.ExchangeAnnouncementReply, error)
- func (client *Client) GetFileMeta(filename string) (*proto.GetFileMetaReply, error)
- func (client *Client) GetFinanceInfo(market uint8, code string) (*proto.GetFinanceInfoReply, error)
- func (client *Client) GetGroupedBlockFile(filename string) ([]BlockGroup, error)
- func (client *Client) GetHistoryMinuteTimeData(date uint32, market uint8, code string) (*proto.GetHistoryMinuteTimeDataReply, error)
- func (client *Client) GetHistoryOrders(date uint32, market uint8, code string) (*proto.GetHistoryOrdersReply, error)
- func (client *Client) GetHistoryTickChart(date uint32, market uint8, code string) (*proto.GetHistoryMinuteTimeDataReply, error)
- func (client *Client) GetHistoryTransactionData(date uint32, market uint8, code string, start uint16, count uint16) (*proto.GetHistoryTransactionDataReply, error)
- func (client *Client) GetHistoryTransactionDataWithTrans(date uint32, market uint8, code string, start uint16, count uint16) (*proto.GetHistoryTransactionDataWithTransReply, error)
- func (client *Client) GetIndexBars(category uint16, market uint8, code string, start uint16, count uint16) (*proto.GetIndexBarsReply, error)
- func (client *Client) GetIndexInfo(market uint8, code string) (*proto.GetIndexInfoReply, error)
- func (client *Client) GetIndexMomentum(market uint8, code string) (*proto.GetIndexMomentumReply, error)
- func (client *Client) GetKLine(category uint16, market uint8, code string, start uint16, count uint16, ...) (*proto.GetSecurityBarsReply, error)
- func (client *Client) GetMACBoardCount(boardType uint16) (*proto.MACBoardCountReply, error)
- func (client *Client) GetMACBoardList(boardType uint16, start uint16, pageSize uint16) (*proto.MACBoardListReply, error)
- func (client *Client) GetMACBoardMembers(boardSymbol string, sortType uint16, start uint32, pageSize uint8, ...) (*proto.MACBoardMembersReply, error)
- func (client *Client) GetMACBoardMembersQuotes(boardSymbol string, sortType uint16, start uint32, pageSize uint8, ...) (*proto.MACBoardMembersQuotesReply, error)
- func (client *Client) GetMACBoardMembersQuotesDynamic(boardSymbol string, sortType uint16, start uint32, pageSize uint8, ...) (*proto.MACBoardMembersQuotesDynamicReply, error)
- func (client *Client) GetMACQuotes(market uint8, code string) (*proto.MACQuotesReply, error)
- func (client *Client) GetMACSymbolBars(market uint8, code string, period uint16, times uint16, start uint32, ...) (*proto.MACSymbolBarsReply, error)
- func (client *Client) GetMACSymbolBelongBoard(market uint8, symbol string) (*proto.MACSymbolBelongBoardReply, error)
- func (client *Client) GetMinuteTimeData(market uint8, code string) (*proto.GetMinuteTimeDataReply, error)
- func (client *Client) GetParsedBlockFile(filename string) ([]BlockFlatItem, error)
- func (client *Client) GetQuotes(markets []uint8, codes []string) (*proto.GetQuotesReply, error)
- func (client *Client) GetQuotesDetail(markets []uint8, codes []string) (*proto.GetSecurityQuotesReply, error)
- func (client *Client) GetQuotesEncrypt(markets []uint8, codes []string) (*proto.GetQuotesEncryptReply, error)
- func (client *Client) GetQuotesList(category uint8, start uint16, count uint16, sortType uint16, reverse bool, ...) (*proto.GetQuotesListReply, error)
- func (client *Client) GetSecurityBars(category uint16, market uint8, code string, start uint16, count uint16) (*proto.GetSecurityBarsReply, error)
- func (client *Client) GetSecurityBarsOffset(category uint16, market uint8, code string, start uint16, count uint16, ...) (*proto.GetSecurityBarsOffsetReply, error)
- func (client *Client) GetSecurityCount(market uint8) (*proto.GetSecurityCountReply, error)
- func (client *Client) GetSecurityFeature452(start uint32, count uint32) (*proto.GetSecurityFeature452Reply, error)
- func (client *Client) GetSecurityList(market uint8, start uint16) (*proto.GetSecurityListReply, error)
- func (client *Client) GetSecurityListOld(market uint8, start uint16) (*proto.GetSecurityListOldReply, error)
- func (client *Client) GetSecurityListRange(market uint8, start uint32, count uint32) (*proto.GetSecurityListReply, error)
- func (client *Client) GetSecurityQuotes(markets []uint8, codes []string) (*proto.GetSecurityQuotesReply, error)
- func (client *Client) GetServerHeartbeat() (*proto.HeartBeatReply, error)
- func (client *Client) GetServerInfo() (*proto.InfoReply, error)
- func (client *Client) GetTableFile(filename string) ([][]string, error)
- func (client *Client) GetTickChart(market uint8, code string, start uint16, count uint16) (*proto.GetMinuteTimeDataReply, error)
- func (client *Client) GetTodoB() (*proto.RawDataReply, error)
- func (client *Client) GetTodoFDE() (*proto.RawDataReply, error)
- func (client *Client) GetTopBoard(category uint8, size uint8) (*proto.GetTopBoardReply, error)
- func (client *Client) GetTransactionData(market uint8, code string, start uint16, count uint16) (*proto.GetTransactionDataReply, error)
- func (client *Client) GetUnusual(market uint8, start uint32, count uint32) (*proto.GetUnusualReply, error)
- func (client *Client) GetVolumeProfile(market uint8, code string) (*proto.GetVolumeProfileReply, error)
- func (client *Client) GetXDXRInfo(market uint8, code string) (*proto.GetXDXRInfoReply, error)
- func (client *Client) MACBoardCount(boardType uint16) (uint16, error)
- func (client *Client) MACBoardList(boardType uint16, count uint32) ([]proto.MACBoardListItem, error)
- func (client *Client) MACBoardMembers(boardSymbol string, count uint32) ([]proto.MACBoardMemberItem, error)
- func (client *Client) MACBoardMembersQuotes(boardSymbol string, count uint32) ([]proto.MACBoardMemberQuoteItem, error)
- func (client *Client) MACBoardMembersQuotesDynamic(boardSymbol string, count uint32, sortType uint16, sortOrder uint8, ...) (*proto.MACBoardMembersQuotesDynamicReply, error)
- func (client *Client) MACBoardMembersQuotesWithSort(boardSymbol string, count uint32, sortType uint16, sortOrder uint8) ([]proto.MACBoardMemberQuoteItem, error)
- func (client *Client) MACBoardMembersWithSort(boardSymbol string, count uint32, sortType uint16, sortOrder uint16) ([]proto.MACBoardMemberItem, error)
- func (client *Client) MACQuotes(market uint8, code string) (*proto.MACQuotesReply, error)
- func (client *Client) MACSymbolBars(market uint8, code string, period uint16, times uint16, start uint32, ...) ([]proto.MACSymbolBar, error)
- func (client *Client) MACSymbolBelongBoard(symbol string, market uint8) ([]proto.MACBelongBoardItem, error)
- func (client *Client) MainClient26AC() (*proto.RawDataReply, error)
- func (client *Client) MainClient26AD() (*proto.RawDataReply, error)
- func (client *Client) MainClient26AE() (*proto.RawDataReply, error)
- func (client *Client) MainClient26B1() (*proto.RawDataReply, error)
- func (client *Client) MainClient264B() (*proto.RawDataReply, error)
- func (client *Client) MainTodoB() (*proto.RawDataReply, error)
- func (client *Client) MainTodoFDE() (*proto.RawDataReply, error)
- func (client *Client) ProbeHosts() []HostProbeResult
- func (client *Client) StockAuction(market uint8, code string, start uint32, count uint32) ([]proto.AuctionData, error)
- func (client *Client) StockBlock(filename string) ([]BlockFlatItem, error)
- func (client *Client) StockChartSampling(market uint8, code string) ([]float64, error)
- func (client *Client) StockCount(market uint8) (uint16, error)
- func (client *Client) StockF10(market uint8, code string) (*CompanyInfoBundle, error)
- func (client *Client) StockFeature452(start uint32, count uint32) ([]proto.SecurityFeature452Item, error)
- func (client *Client) StockHistoryOrders(date uint32, market uint8, code string) ([]proto.HistoryOrderData, error)
- func (client *Client) StockHistoryTickChart(date uint32, market uint8, code string) ([]proto.HistoryMinuteTimeData, error)
- func (client *Client) StockHistoryTransaction(date uint32, market uint8, code string, start uint16, count uint16) ([]proto.HistoryTransactionData, error)
- func (client *Client) StockHistoryTransactionWithTrans(date uint32, market uint8, code string, start uint16, count uint16) ([]proto.HistoryTransactionDataWithTrans, error)
- func (client *Client) StockIndexInfo(market uint8, code string) (*proto.GetIndexInfoReply, error)
- func (client *Client) StockIndexMomentum(market uint8, code string) ([]int, error)
- func (client *Client) StockKLine(category uint16, market uint8, code string, start uint16, count uint16, ...) ([]proto.SecurityBar, error)
- func (client *Client) StockKLineOffset(category uint16, market uint8, code string, start uint16, count uint16, ...) ([]proto.SecurityBar, error)
- func (client *Client) StockList(market uint8, start uint32, count uint32) ([]proto.Security, error)
- func (client *Client) StockListOld(market uint8, start uint16) ([]proto.Security, error)
- func (client *Client) StockQuotes(markets []uint8, codes []string) ([]proto.QuoteListItem, error)
- func (client *Client) StockQuotesDetail(markets []uint8, codes []string) ([]proto.SecurityQuote, error)
- func (client *Client) StockQuotesEncrypt(markets []uint8, codes []string) ([]proto.EncryptedQuoteItem, error)
- func (client *Client) StockQuotesList(category uint8, start uint16, count uint16, sortType uint16, reverse bool, ...) ([]proto.QuoteListItem, error)
- func (client *Client) StockTickChart(market uint8, code string, start uint16, count uint16) ([]proto.MinuteTimeData, error)
- func (client *Client) StockTopBoard(category uint8, size uint8) (*proto.GetTopBoardReply, error)
- func (client *Client) StockTransaction(market uint8, code string, start uint16, count uint16) ([]proto.TransactionData, error)
- func (client *Client) StockUnusual(market uint8, start uint32, count uint32) ([]proto.UnusualData, error)
- func (client *Client) StockVolumeProfile(market uint8, code string) (*proto.GetVolumeProfileReply, error)
- type CompanyInfoBundle
- type CompanyInfoSection
- type HostInfo
- type HostProbeResult
- func FastestAddress(addresses []string, timeout time.Duration) (HostProbeResult, error)
- func FastestHost(hosts []HostInfo, timeout time.Duration) (HostProbeResult, error)
- func ProbeAddresses(addresses []string, timeout time.Duration) []HostProbeResult
- func ProbeHosts(hosts []HostInfo, timeout time.Duration) []HostProbeResult
- type Option
- func WithAutoSelectFastest(enabled bool) Option
- func WithExTCPAddress(tcpAddress string) Option
- func WithExTCPAddressPool(ips ...string) Option
- func WithMacExTCPAddress(tcpAddress string) Option
- func WithMacExTCPAddressPool(ips ...string) Option
- func WithMacTCPAddress(tcpAddress string) Option
- func WithMacTCPAddressPool(ips ...string) Option
- func WithTCPAddress(tcpAddress string) Option
- func WithTCPAddressPool(ips ...string) Option
- func WithTimeoutSec(timeoutSec int) Option
- type Options
Constants ¶
const ( DefaultMACBoardListCount = 10000 DefaultMACBoardPageSize uint16 = 150 DefaultMACBoardStockCount uint32 = 10000 DefaultMACBoardStockPage uint8 = 80 DefaultMACSymbolBarsCount uint32 = 800 DefaultMACSymbolBarsPage uint16 = 700 )
const ( MarketSZ uint8 = 0 // 深圳 MarketSH uint8 = 1 // 上海 MarketBJ uint8 = 2 // 北京 // Backward-compatible aliases. MarketSz = MarketSZ MarketSh = MarketSH MarketBj = MarketBJ )
const ( ExMarketStock uint8 = 1 // 股票 ExMarketHK uint8 = 2 // 香港 ExMarketFutures uint8 = 3 // 期货 ExMarketFX uint8 = 4 // 汇率 ExMarketIndex uint8 = 5 // 指数 ExMarketValuation uint8 = 6 // 估值 ExMarketMoney uint8 = 7 // 资金 ExMarketFund uint8 = 8 // 基金 ExMarketMonetaryFund uint8 = 9 // 货币基金 ExMarketIndicator uint8 = 10 // 指标 ExMarketMirror uint8 = 11 // 镜像 ExMarketOption uint8 = 12 // 期权 ExMarketUS uint8 = 13 // 美国 ExMarketDE uint8 = 14 // 德国 ExMarketSG uint8 = 15 // 新加坡 )
const ( ExCategoryTempStock uint8 = 1 ExCategoryZZFuturesOption uint8 = 4 ExCategoryDLFuturesOption uint8 = 5 ExCategorySHFuturesOption uint8 = 6 ExCategoryCFFEXOption uint8 = 7 ExCategorySHStockOption uint8 = 8 ExCategorySZStockOption uint8 = 9 ExCategoryBasicFX uint8 = 10 ExCategoryCrossFX uint8 = 11 ExCategoryIntlIndex uint8 = 12 ExCategoryCOMEXFutures uint8 = 16 ExCategoryNYMEXFutures uint8 = 17 ExCategoryCBOTFutures uint8 = 18 ExCategoryHKFinancialFutures uint8 = 23 ExCategoryHKFinancialOptions uint8 = 24 ExCategoryHKStockFutures uint8 = 25 ExCategoryHKStockOptions uint8 = 26 ExCategoryHKIndex uint8 = 27 ExCategoryZZFutures uint8 = 28 ExCategoryDLFutures uint8 = 29 ExCategorySHFutures uint8 = 30 ExCategoryHKMainBoard uint8 = 31 ExCategoryOpenEndFund uint8 = 33 ExCategoryMonetaryFund uint8 = 34 ExCategoryMacroIndicator uint8 = 38 ExCategoryFuturesIndex uint8 = 42 ExCategoryBToH uint8 = 43 ExCategoryNEEQ uint8 = 44 ExCategorySHGold uint8 = 46 ExCategoryCFFEXFutures uint8 = 47 ExCategoryHKGEM uint8 = 48 ExCategoryHKFund uint8 = 49 ExCategoryTreasuryValuation uint8 = 54 ExCategorySunshinePrivateFund uint8 = 56 ExCategoryBrokerCollective uint8 = 57 ExCategoryBrokerMonetary uint8 = 58 ExCategoryMainFuturesContract uint8 = 60 ExCategoryCSIIndex uint8 = 62 ExCategoryGZArbitrageFutures uint8 = 65 ExCategoryGZFutures uint8 = 66 ExCategoryGZOptions uint8 = 67 ExCategoryRiskControlIndex uint8 = 68 ExCategoryHuazhengIndex uint8 = 69 ExCategoryExtendedSectorIndex uint8 = 70 ExCategoryHKStock uint8 = 71 ExCategoryGEStock uint8 = 73 ExCategoryUSStock uint8 = 74 ExCategorySGStock uint8 = 78 ExCategoryMoneyMarket uint8 = 91 ExCategoryFundValuation uint8 = 93 ExCategoryHKDarkPool uint8 = 98 ExCategoryCodeMirror uint8 = 100 ExCategorySZSEIndex uint8 = 102 )
const ( DefaultSecurityListCount = 1600 DefaultTickChartCount = 0xba00 DefaultAuctionCount = 500 DefaultUnusualCount = 600 DefaultTopBoardSize = 20 DefaultQuotesListCount = 80 DefaultExListCount = 2000 DefaultExQuotesCount = 100 DefaultDownloadSize = 0x7530 )
const ( AdjustNone uint16 = 0 AdjustQFQ uint16 = 1 AdjustHFQ uint16 = 2 )
const ( CategorySH uint8 = 0 // 上证A CategorySZ uint8 = 2 // 深证A CategoryA uint8 = 6 // A股 CategoryB uint8 = 7 // B股 CategoryKCB uint8 = 8 // 科创板 CategoryBJ uint8 = 12 // 北证A CategoryCYB uint8 = 14 // 创业板 )
const ( FilterNew uint16 = 1 FilterKC uint16 = 2 FilterST uint16 = 4 FilterCY uint16 = 8 FilterBJ uint16 = 16 )
const ( SortCode uint16 = 0x0 SortName uint16 = 0x1 SortPreClose uint16 = 0x2 SortOpen uint16 = 0x3 SortHigh uint16 = 0x4 SortLow uint16 = 0x5 SortPrice uint16 = 0x6 SortBid uint16 = 0x7 SortAsk uint16 = 0x8 SortVolume uint16 = 0x9 SortTotalAmount uint16 = 0x0a SortLastVolume uint16 = 0x0b SortChange uint16 = 0x0c SortChangePct uint16 = 0x0e SortAmplitudePct uint16 = 0x0f SortAvg uint16 = 0x10 SortPEDynamic uint16 = 0x11 SortEntrustRatio uint16 = 0x12 SortInsideVolume uint16 = 0x13 SortOutsideVolume uint16 = 0x14 SortInOutRatio uint16 = 0x15 SortBidVolume uint16 = 0x17 SortAskVolume uint16 = 0x18 SortLockedRatio uint16 = 0x1b SortLockedAmount uint16 = 0x1c SortOpenAmount uint16 = 0x1d SortOpenTurnoverPct uint16 = 0x1e SortVolRatio uint16 = 0x23 SortTurnoverRate uint16 = 0x24 SortFloatMarketCap uint16 = 0x26 SortTotalMarketCapAB uint16 = 0x27 SortUnmatchedVolume uint16 = 0x2a SortStrengthPct uint16 = 0x2d SortSpeedPct uint16 = 0x2e SortActivity uint16 = 0x2f SortShortTurnoverPct uint16 = 0xcc SortVolSpeedPct uint16 = 0xd0 SortMainNetAmount uint16 = 0xd4 SortMainNetRatio uint16 = 0xd7 SortAuctionLimitBuy uint16 = 0x102 SortOpenSnatchPct uint16 = 0x10a SortAmount2M uint16 = 0x10c SortOpenPct uint16 = 0x119 SortHighPct uint16 = 0x11a SortLowPct uint16 = 0x11b SortAvgChangePct uint16 = 0x11c SortDrawdownPct uint16 = 0x11e SortAttackPct uint16 = 0x11f )
const ( SortOrderNone uint16 = 0 SortOrderDesc uint16 = 1 SortOrderAsc uint16 = 2 )
const ( BlockFileDefault = "block.dat" BlockFileZS = "block_zs.dat" BlockFileFG = "block_fg.dat" BlockFileGN = "block_gn.dat" )
const ( BoardTypeHY uint16 = 0 BoardTypeHY2 uint16 = 1 BoardTypeGN uint16 = 3 BoardTypeFG uint16 = 4 BoardTypeDQ uint16 = 5 BoardTypeUnknown uint16 = 6 BoardTypeHYOther uint16 = 7 BoardTypeOther11 uint16 = 8 BoardTypeOther12 uint16 = 9 BoardTypeAll uint16 = 255 )
const ( ExBoardTypeHKAll uint16 = 0 ExBoardTypeHKGN uint16 = 1 ExBoardTypeHKHY uint16 = 2 ExBoardTypeUSAll uint16 = 3 ExBoardTypeUSGN uint16 = 4 ExBoardTypeUSHY uint16 = 5 )
const ( KLINE_TYPE_5MIN = 0 // 5 分钟K 线 KLINE_TYPE_15MIN = 1 // 15 分钟K 线 KLINE_TYPE_30MIN = 2 // 30 分钟K 线 KLINE_TYPE_1HOUR = 3 // 1 小时K 线 KLINE_TYPE_DAILY = 4 // 日K 线 KLINE_TYPE_WEEKLY = 5 // 周K 线 KLINE_TYPE_MONTHLY = 6 // 月K 线 KLINE_TYPE_EXHQ_1MIN = 7 // 1 分钟 KLINE_TYPE_1MIN = 8 // 1 分钟K 线 KLINE_TYPE_RI_K = 9 // 日K 线 KLINE_TYPE_3MONTH = 10 // 季K 线 KLINE_TYPE_YEARLY = 11 // 年K 线 KLINE_TYPE_SECONDS = 13 // 多秒K 线 )
Variables ¶
var (
ErrBadData = errors.New("more than 8M data")
)
var ErrMarketCodeCount = errors.New("market code count error")
var ErrNoReachableHosts = errors.New("no reachable hosts")
ErrNoReachableHosts indicates that every probed host failed the TCP dial.
Functions ¶
func BrokerHostAddresses ¶
func BrokerHostAddresses() []string
BrokerHostAddresses returns the built-in broker host:port list.
func DefaultMACBoardMembersQuotesFieldBitmap ¶
func DefaultMACBoardMembersQuotesFieldBitmap() [20]byte
DefaultMACBoardMembersQuotesFieldBitmap 返回与当前稳定成分报价接口一致的默认字段位图。
func ExHostAddresses ¶
func ExHostAddresses() []string
ExHostAddresses returns the built-in extended-market host:port list.
func FullMACBoardMembersQuotesFieldBitmap ¶
func FullMACBoardMembersQuotesFieldBitmap() [20]byte
FullMACBoardMembersQuotesFieldBitmap 返回 20 字节全 1 位图,适合实验性全字段请求。
func MACBoardMembersQuotesFieldBitmapFromBits ¶
MACBoardMembersQuotesFieldBitmapFromBits 根据 bit 列表组装 20 字节字段位图。
func MACExHostAddresses ¶
func MACExHostAddresses() []string
MACExHostAddresses returns the built-in MAC extended-market host:port list.
func MACHostAddresses ¶
func MACHostAddresses() []string
MACHostAddresses returns the built-in MAC quote host:port list.
func MainHostAddresses ¶
func MainHostAddresses() []string
MainHostAddresses returns the built-in main quote host:port list.
Types ¶
type BlockFlatItem ¶
func ParseBlockFlat ¶
func ParseBlockFlat(data []byte) ([]BlockFlatItem, error)
type BlockGroup ¶
func ParseBlockGroups ¶
func ParseBlockGroups(data []byte) ([]BlockGroup, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Connect ¶
func (client *Client) Connect() (*proto.Hello1Reply, error)
Connect 连接券商行情服务器
func (*Client) ConnectEx ¶
func (client *Client) ConnectEx() (*proto.ExLoginReply, error)
ConnectEx 连接扩展市场服务器并完成登录
func (*Client) ConnectMAC ¶
func (*Client) CurrentAddress ¶
func (*Client) DownloadFile ¶
func (client *Client) DownloadFile(filename string, start uint32, size uint32) (*proto.DownloadFileReply, error)
DownloadFile 下载文件片段
func (*Client) DownloadFullFile ¶
DownloadFullFile 下载完整文件
func (*Client) ExBoardList ¶
func (*Client) ExCategoryList ¶
func (client *Client) ExCategoryList() ([]proto.ExCategoryItem, error)
func (*Client) ExChartSampling ¶
func (*Client) ExDownloadFile ¶
func (client *Client) ExDownloadFile(filename string, start uint32, size uint32) (*proto.DownloadFileReply, error)
ExDownloadFile 下载扩展市场文件片段
func (*Client) ExDownloadFullFile ¶
ExDownloadFullFile 下载完整扩展市场文件
func (*Client) ExExperiment2487 ¶
func (*Client) ExExperiment2488 ¶
func (*Client) ExGetBoardList ¶
func (client *Client) ExGetBoardList(boardType uint16, start uint16, pageSize uint16) (*proto.ExGetBoardListReply, error)
ExGetBoardList 获取扩展市场板块榜单
func (*Client) ExGetCategoryList ¶
func (client *Client) ExGetCategoryList() (*proto.ExGetCategoryListReply, error)
ExGetCategoryList 获取扩展市场分类列表
func (*Client) ExGetChartSampling ¶
func (client *Client) ExGetChartSampling(category uint8, code string) (*proto.ExGetChartSamplingReply, error)
ExGetChartSampling 获取扩展市场抽样图
func (*Client) ExGetCount ¶
func (client *Client) ExGetCount() (*proto.ExGetCountReply, error)
ExGetCount 获取扩展市场标的数量
func (*Client) ExGetExperiment2487 ¶
func (client *Client) ExGetExperiment2487(category uint8, code string) (*proto.ExExperiment2487Reply, error)
ExGetExperiment2487 获取扩展市场试验报价 0x2487
func (*Client) ExGetExperiment2488 ¶
func (client *Client) ExGetExperiment2488(category uint8, code string, mode uint16) (*proto.ExExperiment2488Reply, error)
ExGetExperiment2488 获取扩展市场试验报价 0x2488
func (*Client) ExGetFileMeta ¶
func (client *Client) ExGetFileMeta(filename string) (*proto.GetFileMetaReply, error)
ExGetFileMeta 获取扩展市场文件元信息
func (*Client) ExGetHistoryTickChart ¶
func (client *Client) ExGetHistoryTickChart(date uint32, category uint8, code string) (*proto.ExGetHistoryTickChartReply, error)
ExGetHistoryTickChart 获取扩展市场历史分时图
func (*Client) ExGetHistoryTransaction ¶
func (client *Client) ExGetHistoryTransaction(date uint32, category uint8, code string) (*proto.ExGetHistoryTransactionReply, error)
ExGetHistoryTransaction 获取扩展市场历史成交
func (*Client) ExGetKLine ¶
func (client *Client) ExGetKLine(category uint8, code string, period uint16, start uint32, count uint16, times uint16) (*proto.ExGetKLineReply, error)
ExGetKLine 获取扩展市场K线
func (*Client) ExGetKLine2 ¶
func (client *Client) ExGetKLine2(category uint8, code string, period uint16, start uint32, count uint32, times uint16) (*proto.ExGetKLine2Reply, error)
ExGetKLine2 获取扩展市场 K 线协议 0x2489
func (*Client) ExGetListExtra ¶
func (client *Client) ExGetListExtra(a uint16, b uint16, count uint16) (*proto.ExGetListExtraReply, error)
ExGetListExtra 获取扩展市场试验列表
func (*Client) ExGetMapping2562 ¶
func (client *Client) ExGetMapping2562(market uint16, start uint32, count uint32) (*proto.ExMapping2562Reply, error)
ExGetMapping2562 获取扩展市场映射信息
func (*Client) ExGetQuote ¶
ExGetQuote 获取单个扩展市场行情
func (*Client) ExGetQuotes ¶
func (client *Client) ExGetQuotes(categories []uint8, codes []string) (*proto.ExGetQuotesReply, error)
ExGetQuotes 获取批量扩展市场行情
func (*Client) ExGetQuotes2 ¶
func (client *Client) ExGetQuotes2(categories []uint8, codes []string) (*proto.ExGetQuotesReply, error)
ExGetQuotes2 获取批量扩展市场行情,兼容 pytdx2 的第二种批量接口
func (*Client) ExGetQuotesList ¶
func (client *Client) ExGetQuotesList(category uint8, start uint16, count uint16, sortType uint16, reverse bool) (*proto.ExGetQuotesListReply, error)
ExGetQuotesList 获取扩展市场行情列表
func (*Client) ExGetTable ¶
ExGetTable 获取扩展市场表格内容
func (*Client) ExGetTableDetail ¶
ExGetTableDetail 获取扩展市场详细表格内容
func (*Client) ExGetTickChart ¶
func (client *Client) ExGetTickChart(category uint8, code string) (*proto.ExGetTickChartReply, error)
ExGetTickChart 获取扩展市场当日分时图
func (*Client) ExHistoryTransaction ¶
func (*Client) ExListExtra ¶
func (*Client) ExMapping2562 ¶
func (*Client) ExQuotesList ¶
func (*Client) ExTableDetail ¶
func (*Client) ExTickChart ¶
func (*Client) FastestHost ¶
func (client *Client) FastestHost() (HostProbeResult, error)
FastestHost returns the fastest reachable configured address.
func (*Client) GetAnnouncement ¶
func (client *Client) GetAnnouncement() (*proto.AnnouncementReply, error)
GetAnnouncement 获取服务商公告
func (*Client) GetAuction ¶
func (client *Client) GetAuction(market uint8, code string, start uint32, count uint32) (*proto.GetAuctionReply, error)
GetAuction 获取集合竞价
func (*Client) GetBlockFile ¶
GetBlockFile 获取完整板块文件
func (*Client) GetCSVFile ¶
GetCSVFile 获取 CSV 文件
func (*Client) GetChartSampling ¶
func (client *Client) GetChartSampling(market uint8, code string) (*proto.GetChartSamplingReply, error)
GetChartSampling 获取抽样图数据
func (*Client) GetClient26AC ¶
func (client *Client) GetClient26AC() (*proto.RawDataReply, error)
GetClient26AC 获取客户端信息协议 0x26ac 的原始响应
func (*Client) GetClient26AD ¶
func (client *Client) GetClient26AD() (*proto.RawDataReply, error)
GetClient26AD 获取客户端信息协议 0x26ad 的原始响应
func (*Client) GetClient26AE ¶
func (client *Client) GetClient26AE() (*proto.RawDataReply, error)
GetClient26AE 获取客户端信息协议 0x26ae 的原始响应
func (*Client) GetClient26B1 ¶
func (client *Client) GetClient26B1() (*proto.RawDataReply, error)
GetClient26B1 获取客户端信息协议 0x26b1 的原始响应
func (*Client) GetClient264B ¶
func (client *Client) GetClient264B() (*proto.RawDataReply, error)
GetClient264B 获取客户端信息协议 0x264b 的原始响应
func (*Client) GetCompanyCategories ¶
func (client *Client) GetCompanyCategories(market uint8, code string) (*proto.GetCompanyCategoryReply, error)
GetCompanyCategories 获取公司信息分类
func (*Client) GetCompanyContent ¶
func (client *Client) GetCompanyContent(market uint8, code string, filename string, start uint32, length uint32) (*proto.GetCompanyContentReply, error)
GetCompanyContent 获取公司信息内容
func (*Client) GetCompanyInfo ¶
func (client *Client) GetCompanyInfo(market uint8, code string) (*CompanyInfoBundle, error)
GetCompanyInfo 获取公司信息聚合结果
func (*Client) GetExServerInfo ¶
func (client *Client) GetExServerInfo() (*proto.ExServerInfoReply, error)
GetExServerInfo 获取扩展市场服务信息
func (*Client) GetExchangeAnnouncement ¶
func (client *Client) GetExchangeAnnouncement() (*proto.ExchangeAnnouncementReply, error)
GetExchangeAnnouncement 获取交易所公告
func (*Client) GetFileMeta ¶
func (client *Client) GetFileMeta(filename string) (*proto.GetFileMetaReply, error)
GetFileMeta 获取文件元信息
func (*Client) GetFinanceInfo ¶
GetFinanceInfo 获取财务信息
func (*Client) GetGroupedBlockFile ¶
func (client *Client) GetGroupedBlockFile(filename string) ([]BlockGroup, error)
GetGroupedBlockFile 获取并按板块分组解析板块文件
func (*Client) GetHistoryMinuteTimeData ¶
func (client *Client) GetHistoryMinuteTimeData(date uint32, market uint8, code string) (*proto.GetHistoryMinuteTimeDataReply, error)
GetHistoryMinuteTimeData 获取历史分时图数据
func (*Client) GetHistoryOrders ¶
func (client *Client) GetHistoryOrders(date uint32, market uint8, code string) (*proto.GetHistoryOrdersReply, error)
GetHistoryOrders 获取历史委托
func (*Client) GetHistoryTickChart ¶
func (client *Client) GetHistoryTickChart(date uint32, market uint8, code string) (*proto.GetHistoryMinuteTimeDataReply, error)
GetHistoryTickChart 获取历史分时图数据
func (*Client) GetHistoryTransactionData ¶
func (client *Client) GetHistoryTransactionData(date uint32, market uint8, code string, start uint16, count uint16) (*proto.GetHistoryTransactionDataReply, error)
GetHistoryTransactionData 获取历史分时成交
func (*Client) GetHistoryTransactionDataWithTrans ¶
func (client *Client) GetHistoryTransactionDataWithTrans(date uint32, market uint8, code string, start uint16, count uint16) (*proto.GetHistoryTransactionDataWithTransReply, error)
GetHistoryTransactionDataWithTrans 获取带方向的历史分时成交
func (*Client) GetIndexBars ¶
func (client *Client) GetIndexBars(category uint16, market uint8, code string, start uint16, count uint16) (*proto.GetIndexBarsReply, error)
GetIndexBars 获取指数K线
func (*Client) GetIndexInfo ¶
GetIndexInfo 获取指数概况
func (*Client) GetIndexMomentum ¶
func (client *Client) GetIndexMomentum(market uint8, code string) (*proto.GetIndexMomentumReply, error)
GetIndexMomentum 获取指数动量
func (*Client) GetKLine ¶
func (client *Client) GetKLine(category uint16, market uint8, code string, start uint16, count uint16, times uint16, adjust uint16) (*proto.GetSecurityBarsReply, error)
GetKLine 获取K线
func (*Client) GetMACBoardCount ¶
func (client *Client) GetMACBoardCount(boardType uint16) (*proto.MACBoardCountReply, error)
func (*Client) GetMACBoardList ¶
func (*Client) GetMACBoardMembers ¶
func (*Client) GetMACBoardMembersQuotes ¶
func (*Client) GetMACBoardMembersQuotesDynamic ¶
func (client *Client) GetMACBoardMembersQuotesDynamic(boardSymbol string, sortType uint16, start uint32, pageSize uint8, sortOrder uint8, fieldBitmap [20]byte) (*proto.MACBoardMembersQuotesDynamicReply, error)
GetMACBoardMembersQuotesDynamic 获取按位图动态解析的 MAC 板块成分报价。
func (*Client) GetMACQuotes ¶
GetMACQuotes 获取 MAC 单只标的快照与分时采样。
func (*Client) GetMACSymbolBars ¶
func (*Client) GetMACSymbolBelongBoard ¶
func (*Client) GetMinuteTimeData ¶
func (client *Client) GetMinuteTimeData(market uint8, code string) (*proto.GetMinuteTimeDataReply, error)
GetMinuteTimeData 获取分时图数据
func (*Client) GetParsedBlockFile ¶
func (client *Client) GetParsedBlockFile(filename string) ([]BlockFlatItem, error)
GetParsedBlockFile 获取并解析板块文件
func (*Client) GetQuotesDetail ¶
func (client *Client) GetQuotesDetail(markets []uint8, codes []string) (*proto.GetSecurityQuotesReply, error)
GetQuotesDetail 获取详细行情报价
func (*Client) GetQuotesEncrypt ¶
func (client *Client) GetQuotesEncrypt(markets []uint8, codes []string) (*proto.GetQuotesEncryptReply, error)
GetQuotesEncrypt 获取加密行情
func (*Client) GetQuotesList ¶
func (client *Client) GetQuotesList(category uint8, start uint16, count uint16, sortType uint16, reverse bool, filter uint16) (*proto.GetQuotesListReply, error)
GetQuotesList 获取排序行情列表
func (*Client) GetSecurityBars ¶
func (client *Client) GetSecurityBars(category uint16, market uint8, code string, start uint16, count uint16) (*proto.GetSecurityBarsReply, error)
GetSecurityBars 获取股票K线
func (*Client) GetSecurityBarsOffset ¶
func (client *Client) GetSecurityBarsOffset(category uint16, market uint8, code string, start uint16, count uint16, times uint16, adjust uint16) (*proto.GetSecurityBarsOffsetReply, error)
GetSecurityBarsOffset 获取偏移K线
func (*Client) GetSecurityCount ¶
func (client *Client) GetSecurityCount(market uint8) (*proto.GetSecurityCountReply, error)
GetSecurityCount 获取指定市场内的证券数目
func (*Client) GetSecurityFeature452 ¶
func (client *Client) GetSecurityFeature452(start uint32, count uint32) (*proto.GetSecurityFeature452Reply, error)
GetSecurityFeature452 获取证券扩展信息
func (*Client) GetSecurityList ¶
func (client *Client) GetSecurityList(market uint8, start uint16) (*proto.GetSecurityListReply, error)
GetSecurityList 获取市场内指定范围内的所有证券代码
func (*Client) GetSecurityListOld ¶
func (client *Client) GetSecurityListOld(market uint8, start uint16) (*proto.GetSecurityListOldReply, error)
GetSecurityListOld 获取旧版证券列表
func (*Client) GetSecurityListRange ¶
func (client *Client) GetSecurityListRange(market uint8, start uint32, count uint32) (*proto.GetSecurityListReply, error)
GetSecurityListRange 获取市场内指定范围内的证券代码
func (*Client) GetSecurityQuotes ¶
func (client *Client) GetSecurityQuotes(markets []uint8, codes []string) (*proto.GetSecurityQuotesReply, error)
GetSecurityQuotes 获取盘口五档报价
func (*Client) GetServerHeartbeat ¶
func (client *Client) GetServerHeartbeat() (*proto.HeartBeatReply, error)
GetServerHeartbeat 获取服务端心跳返回
func (*Client) GetServerInfo ¶
GetServerInfo 获取主站服务信息
func (*Client) GetTableFile ¶
GetTableFile 获取以竖线分隔的表格文件
func (*Client) GetTickChart ¶
func (client *Client) GetTickChart(market uint8, code string, start uint16, count uint16) (*proto.GetMinuteTimeDataReply, error)
GetTickChart 获取当日分时图数据
func (*Client) GetTodoB ¶
func (client *Client) GetTodoB() (*proto.RawDataReply, error)
GetTodoB 获取主站试验协议 0x000b 的原始响应
func (*Client) GetTodoFDE ¶
func (client *Client) GetTodoFDE() (*proto.RawDataReply, error)
GetTodoFDE 获取主站试验协议 0x0fde 的原始响应
func (*Client) GetTopBoard ¶
GetTopBoard 获取排行榜
func (*Client) GetTransactionData ¶
func (client *Client) GetTransactionData(market uint8, code string, start uint16, count uint16) (*proto.GetTransactionDataReply, error)
GetTransactionData 获取分时成交
func (*Client) GetUnusual ¶
func (client *Client) GetUnusual(market uint8, start uint32, count uint32) (*proto.GetUnusualReply, error)
GetUnusual 获取主力监控
func (*Client) GetVolumeProfile ¶
func (client *Client) GetVolumeProfile(market uint8, code string) (*proto.GetVolumeProfileReply, error)
GetVolumeProfile 获取成交分布
func (*Client) GetXDXRInfo ¶
GetXDXRInfo 获取除权除息信息
func (*Client) MACBoardCount ¶
func (*Client) MACBoardList ¶
func (*Client) MACBoardMembers ¶
func (*Client) MACBoardMembersQuotes ¶
func (*Client) MACBoardMembersQuotesDynamic ¶
func (client *Client) MACBoardMembersQuotesDynamic(boardSymbol string, count uint32, sortType uint16, sortOrder uint8, fieldBitmap [20]byte) (*proto.MACBoardMembersQuotesDynamicReply, error)
MACBoardMembersQuotesDynamic 获取按位图动态解析的 MAC 板块成分报价。
func (*Client) MACBoardMembersQuotesWithSort ¶
func (client *Client) MACBoardMembersQuotesWithSort(boardSymbol string, count uint32, sortType uint16, sortOrder uint8) ([]proto.MACBoardMemberQuoteItem, error)
MACBoardMembersQuotesWithSort 获取 MAC 板块成分报价,并透传排序参数。
func (*Client) MACBoardMembersWithSort ¶
func (client *Client) MACBoardMembersWithSort(boardSymbol string, count uint32, sortType uint16, sortOrder uint16) ([]proto.MACBoardMemberItem, error)
MACBoardMembersWithSort 获取 MAC 板块成员,并透传排序参数。
func (*Client) MACSymbolBars ¶
func (*Client) MACSymbolBelongBoard ¶
func (*Client) MainClient26AC ¶
func (client *Client) MainClient26AC() (*proto.RawDataReply, error)
func (*Client) MainClient26AD ¶
func (client *Client) MainClient26AD() (*proto.RawDataReply, error)
func (*Client) MainClient26AE ¶
func (client *Client) MainClient26AE() (*proto.RawDataReply, error)
func (*Client) MainClient26B1 ¶
func (client *Client) MainClient26B1() (*proto.RawDataReply, error)
func (*Client) MainClient264B ¶
func (client *Client) MainClient264B() (*proto.RawDataReply, error)
func (*Client) MainTodoFDE ¶
func (client *Client) MainTodoFDE() (*proto.RawDataReply, error)
func (*Client) ProbeHosts ¶
func (client *Client) ProbeHosts() []HostProbeResult
ProbeHosts probes the client's configured address list and returns the results sorted by reachability and latency.
func (*Client) StockAuction ¶
func (client *Client) StockAuction(market uint8, code string, start uint32, count uint32) ([]proto.AuctionData, error)
StockAuction 获取集合竞价数据。
func (*Client) StockBlock ¶
func (client *Client) StockBlock(filename string) ([]BlockFlatItem, error)
func (*Client) StockChartSampling ¶
StockChartSampling 获取分时缩略采样价格。
func (*Client) StockF10 ¶
func (client *Client) StockF10(market uint8, code string) (*CompanyInfoBundle, error)
func (*Client) StockFeature452 ¶
func (*Client) StockHistoryOrders ¶
func (client *Client) StockHistoryOrders(date uint32, market uint8, code string) ([]proto.HistoryOrderData, error)
StockHistoryOrders 获取历史委托分布。
func (*Client) StockHistoryTickChart ¶
func (*Client) StockHistoryTransaction ¶
func (*Client) StockHistoryTransactionWithTrans ¶
func (*Client) StockIndexInfo ¶
StockIndexInfo 获取指数概况。
func (*Client) StockIndexMomentum ¶
StockIndexMomentum 获取指数动量序列。
func (*Client) StockKLine ¶
func (*Client) StockKLineOffset ¶
func (*Client) StockListOld ¶
func (*Client) StockQuotes ¶
func (*Client) StockQuotesDetail ¶
func (*Client) StockQuotesEncrypt ¶
func (*Client) StockQuotesList ¶
func (*Client) StockTickChart ¶
func (*Client) StockTopBoard ¶
StockTopBoard 获取主行情排行榜。
func (*Client) StockTransaction ¶
func (*Client) StockUnusual ¶
func (client *Client) StockUnusual(market uint8, start uint32, count uint32) ([]proto.UnusualData, error)
StockUnusual 获取主力监控异动数据。
func (*Client) StockVolumeProfile ¶
func (client *Client) StockVolumeProfile(market uint8, code string) (*proto.GetVolumeProfileReply, error)
StockVolumeProfile 获取成交分布与盘口快照。
type CompanyInfoBundle ¶
type CompanyInfoBundle struct {
Sections []CompanyInfoSection
XDXR []proto.XDXRItem
Finance *proto.GetFinanceInfoReply
}
type CompanyInfoSection ¶
type HostInfo ¶
HostInfo describes a built-in TDX server entry.
func BrokerHosts ¶
func BrokerHosts() []HostInfo
BrokerHosts returns the built-in broker quote servers.
func MACExHosts ¶
func MACExHosts() []HostInfo
MACExHosts returns the built-in MAC extended-market servers.
type HostProbeResult ¶
type HostProbeResult struct {
Name string `json:"name"`
IP string `json:"ip"`
Port int `json:"port"`
Address string `json:"address"`
Latency time.Duration `json:"latency"`
Reachable bool `json:"reachable"`
Error string `json:"error,omitempty"`
}
HostProbeResult records a single TCP probe result.
func FastestAddress ¶
func FastestAddress(addresses []string, timeout time.Duration) (HostProbeResult, error)
FastestAddress returns the fastest reachable address from the supplied list.
func FastestHost ¶
func FastestHost(hosts []HostInfo, timeout time.Duration) (HostProbeResult, error)
FastestHost returns the fastest reachable built-in host entry.
func ProbeAddresses ¶
func ProbeAddresses(addresses []string, timeout time.Duration) []HostProbeResult
ProbeAddresses concurrently dials the supplied host:port list and returns the results sorted by reachability and latency.
func ProbeHosts ¶
func ProbeHosts(hosts []HostInfo, timeout time.Duration) []HostProbeResult
ProbeHosts concurrently dials the supplied built-in host entries and returns the results sorted by reachability and latency.
type Option ¶
type Option func(options *Options)
func WithAutoSelectFastest ¶
WithAutoSelectFastest enables TCP probe sorting before connection attempts.
func WithExTCPAddress ¶
func WithExTCPAddressPool ¶
func WithMacExTCPAddress ¶
func WithMacExTCPAddressPool ¶
func WithMacTCPAddress ¶
func WithMacTCPAddressPool ¶
func WithTCPAddress ¶
func WithTCPAddressPool ¶
func WithTimeoutSec ¶
type Options ¶
type Options struct {
TCPAddress string // 主行情服务器地址
TCPAddressPool []string // 主行情服务器地址池
ExTCPAddress string // 扩展行情服务器地址
ExTCPAddressPool []string // 扩展行情服务器地址池
MacTCPAddress string // MAC 主行情服务器地址
MacTCPAddressPool []string // MAC 主行情服务器地址池
MacExTCPAddress string // MAC 扩展行情服务器地址
MacExTCPAddressPool []string // MAC 扩展行情服务器地址池
AutoSelectFastest bool // 连接前先对地址池做 TCP 测速并优先尝试低延迟节点
MaxRetryTimes int // 重试次数
TimeoutSec int // 连接和读写超时时间,单位秒
}
