Versions in this module Expand all Collapse all v1 v1.0.0 Jul 19, 2022 Changes in this version + const Active + const AdjustFwd + const AdjustNone + const AnyTime + const AtAuctionLimitOrder + const AtAuctionMarketOrder + const Buy + const CanceledStatus + const DayOrder + const Deactive + const DirDown + const DirNeutral + const DirUp + const EnhancedLimitOrder + const ExpiredStatus + const FilledStatus + const GTCOrder + const GoodTilCancel + const GoodTilDate + const GreyOrder + const KLine15M + const KLine1M + const KLine30M + const KLine5M + const KLine60M + const KLineDay + const KLineMonth + const KLineWeek + const KLineYear + const LimitIfTouched + const LimitOrder + const MarketIfTouched + const MarketOrder + const NewStatus + const NormalOrder + const NormalTradingSession + const NotReported + const NotUsed + const OddLotsOrder + const PartialFilledStatus + const PartialWithdrawal + const PendingCancelStatus + const PendingReplaceStatus + const PostTradingSession + const PreTradingSession + const ProtectedNotReported + const RTHOnly + const RejectedStatus + const Released + const ReplacedNotReported + const ReplacedStatus + const Sell + const SubscriptionBrokerQueue + const SubscriptionOrderBook + const SubscriptionRealtimeQuote + const SubscriptionTicker + const TSLPAMT + const TSLPPCT + const TSMAMT + const TSMPCT + const TradeStatusCodeMoved + const TradeStatusDelisted + const TradeStatusExpired + const TradeStatusFuse + const TradeStatusHalted + const TradeStatusNormal + const TradeStatusPrepareList + const TradeStatusSlitStockHalts + const TradeStatusSuspendTrade + const TradeStatusToBeOpened + const TradeStatusWarrantPrepareList + const VarietiesNotReported + const WaitToCancel + const WaitToNew + const WaitToReplace + var OrderTypes = []OrderType + type AccessTokenInfo struct + Code int + Data struct{ ... } + Message string + type AdjustType int32 + type AssetType int + const CashAsset + const FundAsset + const StockAsset + type Balance struct + Cashes []*Cash + Currency string + InitMargin float64 + MaintenanceMargin float64 + MarginCall float64 + MaxFinanceAmount float64 + NetAssets float64 + RemainFinanceAmount float64 + RiskLevel RiskLevel + TotalCash float64 + type Broker struct + IDs []int32 + Position int32 + type BrokerInfo struct + IDs []int32 + NameChinese string + NameEnglish string + NameHK string + type BrokerQueue struct + Ask []*Broker + Bid []*Broker + Symbol Symbol + type CapDistribution struct + Large float64 + Medium float64 + Small float64 + type CapFlowDistribution struct + InFlow CapDistribution + OutFlow CapDistribution + Symbol Symbol + Timestamp int64 + type Cash struct + Available float64 + Currency string + Frozen float64 + Settling float64 + Withdraw float64 + type Cashflow struct + Balance float64 + BusinessTimestamp int64 + BusinessType AssetType + Currency string + Description string + Direction CashflowDirection + Symbol Symbol + TransactionFlowName string + type CashflowDirection int + const Inflow + const Outflow + type CashflowReq struct + BusinessType AssetType + EndTimestamp int64 + IsAll bool + Page uint64 + Size uint64 + StartTimestamp int64 + Symbol Symbol + type Config struct + AccessToken string + AppKey string + AppSecret string + BaseURL string + QuoteEndpoint string + ReconnectInterval int + TradeEndpoint string + type FinanceIndex = quote.CalcIndex + const IndexAmplitude + const IndexBalancePoint + const IndexCallPrice + const IndexCapitalFlow + const IndexChangeRate + const IndexChangeVal + const IndexConversionRatio + const IndexDelta + const IndexDividendRatio_TTM + const IndexEffectiveLeverage + const IndexExpiryDate + const IndexFiveDay_CHANGE_RATE + const IndexFiveMinutes_CHANGE_RATE + const IndexGamma + const IndexHalfYear_CHANGE_RATE + const IndexImpliedVolatility + const IndexItmOtm + const IndexLastDone + const IndexLeverageRatio + const IndexLowerStrike_PRICE + const IndexOpenInterest + const IndexOutstandingQty + const IndexOutstandingRatio + const IndexPbRatio + const IndexPeTtm_RATIO + const IndexPremium + const IndexRho + const IndexStrikePrice + const IndexTenDay_CHANGE_RATE + const IndexTheta + const IndexToCall_PRICE + const IndexTotalMarket_VALUE + const IndexTurnover + const IndexTurnoverRate + const IndexUnknown + const IndexUpperStrike_PRICE + const IndexVega + const IndexVolume + const IndexVolumeRatio + const IndexWarrantDelta + const IndexYtdChange_RATE + type FundPosition struct + AccountChannel string + CostNetAssetValue float64 + Currency string + CurrentNetAssetValue float64 + HoldingUnits float64 + NetAssetValueTimestamp int64 + Symbol Symbol + SymbolName string + type GetHistoryOrderFillsReq struct + EndTimestamp int64 + StartTimestamp int64 + Symbol Symbol + type GetHistoryOrdersReq struct + EndTimestamp int64 + Market Market + Side TrdSide + StartTimestamp int64 + Status []OrderStatus + Symbol Symbol + type GetTodayOrderFillsReq struct + OrderID uint64 + Symbol Symbol + type GetTodyOrdersReq struct + Market Market + OrderID uint64 + Side TrdSide + Status []OrderStatus + Symbol Symbol + type IntradayCapFlow struct + Flow float64 + Timestamp int64 + type IntradayLine struct + AvgPrice float64 + Price float64 + Timestamp int64 + Turnover float64 + Volume int64 + type Issuer struct + ID int32 + NameCn string + NameEn string + NameHk string + type KLine struct + Close float64 + High float64 + Low float64 + Open float64 + Timestamp int64 + Turnover float64 + Volume int64 + type KLineType int32 + type Language int32 + const English + const SimplifiedChinese + const TraditionalChinese + type MarginRatio struct + ForcedSaleRatio float64 + InitRatio float64 + MaintenanceRatio float64 + type Market string + const HK + const US + type MarketSession struct + BeginTime int32 + EndTime int32 + SessionType TradeSessionType + type MarketTradePeriod struct + Market Market + TradeSessions []*MarketSession + type ModifyOrderReq struct + LimitOffset float64 + OrderID string + Price float64 + Quantity uint64 + Remark string + TrailingAmount float64 + TrailingPercent float64 + TriggerPrice float64 + type OptionExtend struct + ContractMultiplier float64 + ContractSize float64 + ContractType string + Direction string + ExpiryDate string + HistoricalVolatility float64 + ImpliedVolatility float64 + OpenInterest int64 + StrikePrice float64 + UnderlyingSymbol Symbol + type Order struct + Currency string + ExecutedPrice float64 + ExecutedQuantity uint64 + ExpireDate string + LastDone string + LimitOffset float64 + Msg string + OrderID uint64 + OrderType OrderType + OutsideRTH OutsideRTH + Price float64 + Quantity uint64 + Side TrdSide + Status OrderStatus + StockName string + SubmittedTimestamp int64 + Symbol Symbol + Tag OrderTag + TimeInForce TimeInForce + TrailingAmount float64 + TrailingPercent float64 + TriggerPrice float64 + TriggerStatus TriggerStatus + TriggerTimestamp int64 + UpdatedTimestamp int64 + type OrderBook struct + OrderNum int64 + Position int32 + Price float64 + Volume int64 + type OrderBookList struct + Ask []*OrderBook + Bid []*OrderBook + Symbol Symbol + type OrderFill struct + OrderID uint64 + Price float64 + Quantity uint64 + Symbol Symbol + TradeDoneTimestamp int64 + TradeID string + type OrderStatus string + type OrderTag string + type OrderType string + func (ot OrderType) String() string + type OutsideRTH string + type PlaceOrderReq struct + ExpireDate time.Time + LimitOffset float64 + OrderType OrderType + OutsideRTH OutsideRTH + Price float64 + Quantity uint64 + Remark string + Side TrdSide + Symbol Symbol + TimeInForce TimeInForce + TrailingAmount float64 + TrailingPercent float64 + TriggerPrice float64 + type PostMarketQuote struct + High float64 + LastDone float64 + Low float64 + PrevClose float64 + Timestamp int64 + Turnover float64 + Volume int64 + type PreMarketQuote struct + High float64 + LastDone float64 + Low float64 + PrevClose float64 + Timestamp int64 + Turnover float64 + Volume int64 + type PushBrokers struct + Ask []*Broker + Bid []*Broker + Sequence int64 + Symbol Symbol + type PushOrderBook struct + Ask []*OrderBook + Bid []*OrderBook + Sequence int64 + Symbol Symbol + type PushQuote struct + CurrentTurnover float64 + CurrentVolume int64 + High float64 + LastDone float64 + Low float64 + Open float64 + Sequence int64 + Symbol Symbol + Timestamp int64 + TradeSession TradeSessionType + TradeStatus TradeStatus + Turnover float64 + Volume int64 + type PushTickers struct + Sequence int64 + Symbol Symbol + Tickers []*Ticker + type QotSubscription struct + Subscriptions []SubscriptionType + Symbol Symbol + type QuoteClient struct + func NewQuoteClient(conf *Config) (*QuoteClient, error) + func (c *QuoteClient) Close() + func (c *QuoteClient) GetWatchedGroups() ([]*WatchedGroup, error) + func (c QuoteClient) GetBrokerInfo() ([]*BrokerInfo, error) + func (c QuoteClient) GetBrokerQueue(symbol Symbol) (*BrokerQueue, error) + func (c QuoteClient) GetFinanceIndices(symbols []Symbol, indices []FinanceIndex) ([]*SecurityFinanceIndex, error) + func (c QuoteClient) GetIntradayCapFlowDistribution(symbol Symbol) (*CapFlowDistribution, error) + func (c QuoteClient) GetIntradayCapFlows(symbol Symbol) ([]*IntradayCapFlow, error) + func (c QuoteClient) GetIntradayLines(symbol Symbol) ([]*IntradayLine, error) + func (c QuoteClient) GetKLines(symbol Symbol, klType KLineType, count int32, adj AdjustType) ([]*KLine, error) + func (c QuoteClient) GetMarketTradePeriods() ([]*MarketTradePeriod, error) + func (c QuoteClient) GetOptionExpiryDates(symbol Symbol) ([]string, error) + func (c QuoteClient) GetOptionStrikePrices(symbol Symbol, expiry string) ([]*StrikePriceInfo, error) + func (c QuoteClient) GetOrderBookList(symbol Symbol) (*OrderBookList, error) + func (c QuoteClient) GetRealtimeOptionQuote(symbols []Symbol) ([]*RealtimeOptionQuote, error) + func (c QuoteClient) GetRealtimeQuote(symbols []Symbol) ([]*RealTimeQuote, error) + func (c QuoteClient) GetRealtimeWarrantQuote(symbols []Symbol) ([]*RealtimeWarrantQuote, error) + func (c QuoteClient) GetStaticInfo(symbols []Symbol) ([]*StaticInfo, error) + func (c QuoteClient) GetSubscriptions() ([]*QotSubscription, error) + func (c QuoteClient) GetTickers(symbol Symbol, count int) ([]*Ticker, error) + func (c QuoteClient) GetTradeDates(market Market, begin string, end string) ([]TradeDate, error) + func (c QuoteClient) GetWarrantIssuers() ([]*Issuer, error) + func (c QuoteClient) RefreshAccessToken(expire time.Time) (*AccessTokenInfo, error) + func (c QuoteClient) SearchWarrants(cond *WarrantFilter) ([]*Warrant, error) + func (c QuoteClient) SubscribePush(symbols []Symbol, subTypes []SubscriptionType, needFirstPush bool) ([]*QotSubscription, error) + func (c QuoteClient) UnsubscribePush(symbols []Symbol, subTypes []SubscriptionType, all bool) error + type RealTimeQuote struct + High float64 + LastDone float64 + Low float64 + Open float64 + PostMarketQuote *PostMarketQuote + PreMarketQuote *PreMarketQuote + PrevClose float64 + Symbol Symbol + Timestamp int64 + Turnover float64 + Volume int64 + type RealtimeOptionQuote struct + High float64 + LastDone float64 + Low float64 + Open float64 + OptionExtend *OptionExtend + PrevClose float64 + Symbol Symbol + Timestamp int64 + Turnover float64 + Volume int64 + type RealtimeWarrantQuote struct + High float64 + LastDone float64 + Low float64 + Open float64 + PrevClose float64 + Symbol Symbol + Timestamp int64 + Turnover float64 + Volume int64 + WarrantExtend *WarrantExtended + type Request struct + Body proto.Message + Cmd uint32 + type RiskLevel int + const High + const Low + const LowToMedium + const Medium + const MediumToHigh + type SecurityFinanceIndex struct + Amplitude float64 + BalancePoint float64 + CallPrice float64 + CapitalFlow float64 + ChangeRate float64 + ChangeVal float64 + ConversionRatio float64 + Delta float64 + DividendRatioTtm float64 + EffectiveLeverage float64 + ExpiryDate string + FiveDayChangeRate float64 + FiveMinutesChangeRate float64 + Gamma float64 + HalfYearChangeRate float64 + ImpliedVolatility float64 + ItmOtm float64 + LastDone float64 + LeverageRatio float64 + LowerStrikePrice float64 + OpenInterest int64 + OutstandingQty int64 + OutstandingRatio float64 + PbRatio float64 + PeTtmRatio float64 + Premium float64 + Rho float64 + StrikePrice float64 + Symbol Symbol + TenDayChangeRate float64 + Theta float64 + ToCallPrice float64 + TotalMarketValue float64 + Turnover float64 + TurnoverRate float64 + UpperStrikePrice float64 + Vega float64 + Volume int64 + VolumeRatio float64 + WarrantDelta float64 + YtdChangeRate float64 + type StaticInfo struct + Board string + Bps float64 + CirculatingShares int64 + Currency string + DividendYield float64 + Eps float64 + EpsTtm float64 + Exchange string + HkShares int64 + LotSize int32 + NameCn string + NameEn string + NameHk string + StockDerivatives []int32 + Symbol Symbol + TotalShares int64 + type StockPosition struct + AccountChannel string + AvailableQuantity int64 + CostPrice float64 + Currency string + Quantity uint64 + Symbol Symbol + SymbolName string + type StrikePriceInfo struct + CallSymbol string + Price float64 + PutSymbol string + Standard bool + type SubscriptionType = quote.SubType + type Symbol string + func MakeSymbol(stockCode string, market Market) Symbol + func (s Symbol) ToStock() (string, Market, error) + type Ticker struct + Dir TradeDir + Price float64 + Timestamp int64 + TradeSession TradeSessionType + TradeType string + Volume int64 + type TimeInForce string + type TradeClient struct + func NewTradeClient(conf *Config) (*TradeClient, error) + func (c *TradeClient) CancelOrder(orderID string) error + func (c *TradeClient) Close() + func (c *TradeClient) GetAccountBalances() ([]*Balance, error) + func (c *TradeClient) GetCashflows(r *CashflowReq) ([]*Cashflow, error) + func (c *TradeClient) GetFundPositions(fundSymbols ...Symbol) ([]*FundPosition, error) + func (c *TradeClient) GetHistoryOrderFills(r *GetHistoryOrderFillsReq) ([]*OrderFill, error) + func (c *TradeClient) GetHistoryOrders(r *GetHistoryOrdersReq) ([]*Order, error) + func (c *TradeClient) GetMarginRatio(symbol Symbol) (*MarginRatio, error) + func (c *TradeClient) GetStockPositions(symbols ...Symbol) ([]*StockPosition, error) + func (c *TradeClient) GetTodayOrderFills(r *GetTodayOrderFillsReq) ([]*OrderFill, error) + func (c *TradeClient) GetTodayOrders(r *GetTodyOrdersReq) ([]*Order, error) + func (c *TradeClient) ModifyOrder(r *ModifyOrderReq) error + func (c *TradeClient) PlaceOrder(r *PlaceOrderReq) (string, error) + func (c TradeClient) Enable(enable bool) + func (c TradeClient) RefreshAccessToken(expire time.Time) (*AccessTokenInfo, error) + func (c TradeClient) Subscribe(topics []string) error + func (c TradeClient) Unsubscribe(topics []string) error + type TradeDate struct + Date string + TradeDateType int32 + type TradeDir int32 + type TradeSessionType = quote.TradeSession + type TradeStatus = quote.TradeStatus + type TrdSide string + type TriggerStatus string + type Warrant struct + BalancePoint float64 + CallPrice float64 + ChangeRate float64 + ChangeVal float64 + ConversionRatio float64 + Delta float64 + EffectiveLeverage float64 + ExpiryDate string + ImpliedVolatility float64 + ItmOtm float64 + LastDone float64 + LeverageRatio float64 + LowerStrikePrice float64 + Name string + OutstandingQty float64 + OutstandingRatio float64 + Premium float64 + State string + StrikePrice float64 + Symbol Symbol + Turnover float64 + UpperStrikePrice float64 + type WarrantExtended struct + CallPrice float64 + Category string + ConversionRatio float64 + ExpiryDate string + ImpliedVolatility float64 + LastTradeDate string + LowerStrikePrice float64 + OutstandingQty int64 + OutstandingRatio float64 + StrikePrice float64 + UnderlyingSymbol string + UpperStrikePrice float64 + type WarrantFilter struct + ExpiryDateType []int32 + IssuerIDs []int32 + Language Language + PageSize int32 + PriceType []int32 + SortBy int32 + SortOffset int32 + SortOrder int32 + Status []int32 + Symbol Symbol + Type []int32 + type WatchedGroup struct + ID string + Name string + Securities []*WatchedSecurity + type WatchedSecurity struct + Name string + Symbol Symbol + WatchedAt int64 + WatchedPrice float64 + func (wg *WatchedSecurity) String() string