futu

package module
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: MIT Imports: 85 Imported by: 0

README

Futu open api golang client

GoDoc CI codecov Release

富途牛牛 OpenAPI Golang 客户端,要求Golang版本 >= 1.21

Futu Open API 官方文档: https://openapi.futunn.com/futu-api-doc/

代码目录说明

  • 根目录: 提供用户友好的客户端SDK,对底层的client包做了一层用法包装
  • client: 基础客户端,拥有所有功能,需要用pb定义的结构体传参,可以直接使用,但是使用起来略繁琐
  • .proto: protobuf 定义文件
  • adapt: protobuf 结构体和普通类型的适配层
  • infra: 底层支持库,使用者无需关心
  • pb: 基于 protobuf 文件生成的 golang 代码
  • protoid: 接口ID常量列表

使用说明

本SDK跟FutuOpenD的通信协议格式是protobuf,使用FutuOpenD的默认配置即可,不要改成json格式。

具体用法可以参考单元测试,里面每个接口都有用例。

方法设计的原则是,必填参数显式要求传递,可选参数放在可变参数adapt.Option传递。但有部分必填参数实际上可以有默认值,这种情况不会显式要求传递。

每个接口都有一对方法,其中结尾有WithContext的方法是方便让使用者可以自己通过context设置超时时间,不带WithContext的方法使用了默认超时时间5s。

以下是一个简单示例:

import "github.com/hyperjiang/futu"

sdk, err := futu.NewSDK()
if err != nil {
    log.Fatal(err)
}

res, err := sdk.GetGlobalState()
fmt.Println(res)

对于系统推送过来的数据,需要调用RegisterHandler(protoID uint32, h Handler)来注册自己的处理逻辑。 如果没有设置,SDK会使用默认的Handler,只打印收到的消息到日志。 可以设置推送Handler的协议ID如下:

  • protoid.Notify // 1003
  • protoid.TrdUpdateOrder // 2208
  • protoid.TrdUpdateOrderFill // 2218
  • protoid.QotUpdateBasicQot // 3005
  • protoid.QotUpdateKL // 3007
  • protoid.QotUpdateRT // 3009
  • protoid.QotUpdateTicker // 3011
  • protoid.QotUpdateOrderBook // 3013
  • protoid.QotUpdateBroker // 3015
  • protoid.QotUpdatePriceReminder // 3019

设置其他ID没有任何作用,因为永远不可能触发到。

支持的功能

基础功能(用户无需调用)
  • 支持使用RSA和AES加解密
  • 初始化连接
  • 获取全局状态
  • 事件通知推送
  • 保活心跳
行情接口
  • QotSub = 3001 // 订阅或者反订阅
  • QotGetSubInfo = 3003 // 获取订阅信息
  • QotGetBasicQot = 3004 // 获取股票基本报价
  • QotUpdateBasicQot = 3005 // 推送股票基本报价
  • QotGetKL = 3006 // 获取K线
  • QotUpdateKL = 3007 // 推送K线
  • QotGetRT = 3008 // 获取分时
  • QotUpdateRT = 3009 // 推送分时
  • QotGetTicker = 3010 // 获取逐笔
  • QotUpdateTicker = 3011 // 推送逐笔
  • QotGetOrderBook = 3012 // 获取买卖盘
  • QotUpdateOrderBook = 3013 // 推送买卖盘
  • QotGetBroker = 3014 // 获取经纪队列
  • QotUpdateBroker = 3015 // 推送经纪队列
  • QotUpdatePriceReminder = 3019 // 到价提醒通知
  • QotRequestHistoryKL = 3103 // 在线获取单只股票一段历史K线
  • QotRequestHistoryKLQuota = 3104 // 获取历史K线额度
  • QotRequestRehab = 3105 // 在线获取单只股票复权信息
  • QotGetStaticInfo = 3202 // 获取股票静态信息
  • QotGetSecuritySnapshot = 3203 // 获取股票快照
  • QotGetPlateSet = 3204 // 获取板块集合下的板块
  • QotGetPlateSecurity = 3205 // 获取板块下的股票
  • QotGetReference = 3206 // 获取正股相关股票
  • QotGetOwnerPlate = 3207 // 获取股票所属板块
  • QotGetOptionChain = 3209 // 获取期权链
  • QotGetWarrant = 3210 // 获取窝轮
  • QotGetCapitalFlow = 3211 // 获取资金流向
  • QotGetCapitalDistribution = 3212 // 获取资金分布
  • QotGetUserSecurity = 3213 // 获取自选股分组下的股票
  • QotModifyUserSecurity = 3214 // 修改自选股分组下的股票
  • QotStockFilter = 3215 // 获取条件选股
  • QotGetIpoList = 3217 // 获取新股
  • QotGetFutureInfo = 3218 // 获取期货合约资料
  • QotRequestTradeDate = 3219 // 获取市场交易日,在线拉取不在本地计算
  • QotSetPriceReminder = 3220 // 设置到价提醒
  • QotGetPriceReminder = 3221 // 获取到价提醒
  • QotGetUserSecurityGroup = 3222 // 获取自选股分组列表
  • QotGetMarketState = 3223 // 获取指定品种的市场状态
  • QotGetOptionExpirationDate = 3224 // 获取期权到期日
  • QotGetFinancialsEarningsPriceMove = 3225 // 获取财报盈利预测变动
  • QotGetFinancialsEarningsPriceHistory = 3226 // 获取财报盈利预测历史
  • QotGetFinancialsStatements = 3227 // 获取财务报表
  • QotGetFinancialsRevenueBreakdown = 3228 // 获取主营构成
  • QotGetResearchAnalystConsensus = 3229 // 获取分析师评级汇总
  • QotGetResearchRatingSummary = 3230 // 获取分析师评级详情
  • QotGetResearchMorningstarReport = 3231 // 获取晨星研报
  • QotGetValuationDetail = 3232 // 获取估值详情
  • QotGetValuationPlateStockList = 3233 // 获取板块估值股票列表
  • QotGetCorporateActionsDividends = 3234 // 获取除权除息
  • QotGetCorporateActionsBuybacks = 3235 // 获取回购
  • QotGetCorporateActionsStockSplits = 3236 // 获取拆合股
  • QotGetShareholdersOverview = 3237 // 获取股东概要
  • QotGetShareholdersHoldingChanges = 3238 // 获取持股变动
  • QotGetShareholdersHolderDetail = 3239 // 获取股东持仓明细
  • QotGetShareholdersInstitutional = 3240 // 获取机构持仓
  • QotGetInsiderHolderList = 3241 // 获取内部持有人列表
  • QotGetInsiderTradeList = 3242 // 获取内部人交易列表
  • QotGetCompanyProfile = 3243 // 获取公司资料
  • QotGetCompanyExecutives = 3244 // 获取公司高管
  • QotGetCompanyExecutiveBackground = 3245 // 获取高管背景
  • QotGetCompanyOperationalEfficiency = 3246 // 获取营运效率
  • QotGetTopTenBuySellBrokers = 3247 // 获取十大经纪商
  • QotGetDailyShortVolume = 3248 // 获取每日做空量
  • QotGetShortInterest = 3249 // 获取做空比例
  • QotGetOptionVolatility = 3250 // 获取期权波动率
  • QotGetOptionExerciseProbability = 3251 // 获取期权行权概率
  • QotStockScreen = 3252 // 条件选股
  • QotOptionScreen = 3253 // 期权筛选
  • QotWarrantScreen = 3254 // 窝轮筛选
交易接口
  • TrdGetAccList = 2001 // 获取交易业务账户列表
  • TrdUnlockTrade = 2005 // 解锁或锁定交易
  • TrdSubAccPush = 2008 // 订阅业务账户的交易推送数据
  • TrdGetFunds = 2101 // 获取账户资金
  • TrdGetPositionList = 2102 // 获取账户持仓
  • TrdGetMaxTrdQtys = 2111 // 获取最大交易数量
  • TrdGetOrderList = 2201 // 获取订单列表
  • TrdPlaceOrder = 2202 // 下单
  • TrdModifyOrder = 2205 // 修改订单
  • TrdUpdateOrder = 2208 // 推送订单状态变动通知
  • TrdGetOrderFillList = 2211 // 获取成交列表
  • TrdUpdateOrderFill = 2218 // 推送成交通知
  • TrdGetHistoryOrderList = 2221 // 获取历史订单列表
  • TrdGetHistoryOrderFillList = 2222 // 获取历史成交列表
  • TrdGetMarginRatio = 2223 // 获取融资融券数据
  • TrdGetOrderFee = 2225 // 获取订单费用
  • TrdFlowSummary = 2226 // 查询账户现金流水

Documentation

Index

Constants

View Source
const (
	DateFormat = "2006-01-02"
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SDK

type SDK struct {
	client.Options
	// contains filtered or unexported fields
}

SDK is Futu SDK.

func NewSDK

func NewSDK(opts ...client.Option) (*SDK, error)

NewSDK creates a new Futu SDK.

func (*SDK) Close

func (sdk *SDK) Close() error

Close closes the client.

func (*SDK) GetAccList

func (sdk *SDK) GetAccList(opts ...adapt.Option) ([]*trdcommon.TrdAcc, error)

GetAccList 2001 - gets the trading account list.

func (*SDK) GetAccListWithContext

func (sdk *SDK) GetAccListWithContext(ctx context.Context, opts ...adapt.Option) ([]*trdcommon.TrdAcc, error)

GetAccListWithContext 2001 - gets the account list with context.

func (*SDK) GetBasicQot

func (sdk *SDK) GetBasicQot(codes []string) ([]*qotcommon.BasicQot, error)

GetBasicQot 3004 - gets the basic quotes of given securities.

func (*SDK) GetBasicQotWithContext

func (sdk *SDK) GetBasicQotWithContext(ctx context.Context, codes []string) ([]*qotcommon.BasicQot, error)

GetBasicQotWithContext 3004 - gets the basic quotes of given securities with context.

func (*SDK) GetBroker

func (sdk *SDK) GetBroker(code string) (*qotgetbroker.S2C, error)

GetBroker 3014 - gets broker data.

code: security code

func (*SDK) GetBrokerWithContext

func (sdk *SDK) GetBrokerWithContext(ctx context.Context, code string) (*qotgetbroker.S2C, error)

GetBrokerWithContext 3014 - gets the broker with context.

code: security code

func (*SDK) GetCapitalDistribution

func (sdk *SDK) GetCapitalDistribution(code string) (*qotgetcapitaldistribution.S2C, error)

GetCapitalDistribution 3212 - gets the capital distribution.

code: security code

func (*SDK) GetCapitalDistributionWithContext

func (sdk *SDK) GetCapitalDistributionWithContext(ctx context.Context, code string) (*qotgetcapitaldistribution.S2C, error)

GetCapitalDistributionWithContext 3212 - gets the capital distribution with context.

code: security code

func (*SDK) GetCapitalFlow

func (sdk *SDK) GetCapitalFlow(code string, opts ...adapt.Option) (*qotgetcapitalflow.S2C, error)

GetCapitalFlow 3211 - gets the capital flow.

code: security code

func (*SDK) GetCapitalFlowWithContext

func (sdk *SDK) GetCapitalFlowWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetcapitalflow.S2C, error)

GetCapitalFlowWithContext 3211 - gets the capital flow with context.

code: security code

func (*SDK) GetClient

func (sdk *SDK) GetClient() *client.Client

GetClient returns the client.

func (*SDK) GetCompanyExecutiveBackground added in v1.7.0

func (sdk *SDK) GetCompanyExecutiveBackground(code string, opts ...adapt.Option) (*qotgetcompanyexecutivebackground.S2C, error)

GetCompanyExecutiveBackground 3245 - gets the company executive background.

code: security code

func (*SDK) GetCompanyExecutiveBackgroundWithContext added in v1.7.0

func (sdk *SDK) GetCompanyExecutiveBackgroundWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetcompanyexecutivebackground.S2C, error)

GetCompanyExecutiveBackgroundWithContext 3245 - gets the company executive background with context.

code: security code

func (*SDK) GetCompanyExecutives added in v1.7.0

func (sdk *SDK) GetCompanyExecutives(code string) (*qotgetcompanyexecutives.S2C, error)

GetCompanyExecutives 3244 - gets the company executives.

code: security code

func (*SDK) GetCompanyExecutivesWithContext added in v1.7.0

func (sdk *SDK) GetCompanyExecutivesWithContext(ctx context.Context, code string) (*qotgetcompanyexecutives.S2C, error)

GetCompanyExecutivesWithContext 3244 - gets the company executives with context.

code: security code

func (*SDK) GetCompanyOperationalEfficiency added in v1.7.0

func (sdk *SDK) GetCompanyOperationalEfficiency(code string, opts ...adapt.Option) (*qotgetcompanyoperationalefficiency.S2C, error)

GetCompanyOperationalEfficiency 3246 - gets the company operational efficiency.

code: security code

func (*SDK) GetCompanyOperationalEfficiencyWithContext added in v1.7.0

func (sdk *SDK) GetCompanyOperationalEfficiencyWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetcompanyoperationalefficiency.S2C, error)

GetCompanyOperationalEfficiencyWithContext 3246 - gets the company operational efficiency with context.

code: security code

func (*SDK) GetCompanyProfile added in v1.7.0

func (sdk *SDK) GetCompanyProfile(code string) (*qotgetcompanyprofile.S2C, error)

GetCompanyProfile 3243 - gets the company profile.

code: security code

func (*SDK) GetCompanyProfileWithContext added in v1.7.0

func (sdk *SDK) GetCompanyProfileWithContext(ctx context.Context, code string) (*qotgetcompanyprofile.S2C, error)

GetCompanyProfileWithContext 3243 - gets the company profile with context.

code: security code

func (*SDK) GetCorporateActionsBuybacks added in v1.7.0

func (sdk *SDK) GetCorporateActionsBuybacks(code string, opts ...adapt.Option) (*qotgetcorporateactionsbuybacks.S2C, error)

GetCorporateActionsBuybacks 3235 - gets the corporate actions buybacks.

code: security code

func (*SDK) GetCorporateActionsBuybacksWithContext added in v1.7.0

func (sdk *SDK) GetCorporateActionsBuybacksWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetcorporateactionsbuybacks.S2C, error)

GetCorporateActionsBuybacksWithContext 3235 - gets the corporate actions buybacks with context.

code: security code

func (*SDK) GetCorporateActionsDividends added in v1.7.0

func (sdk *SDK) GetCorporateActionsDividends(code string) (*qotgetcorporateactionsdividends.S2C, error)

GetCorporateActionsDividends 3234 - gets the corporate actions dividends.

code: security code

func (*SDK) GetCorporateActionsDividendsWithContext added in v1.7.0

func (sdk *SDK) GetCorporateActionsDividendsWithContext(ctx context.Context, code string) (*qotgetcorporateactionsdividends.S2C, error)

GetCorporateActionsDividendsWithContext 3234 - gets the corporate actions dividends with context.

code: security code

func (*SDK) GetCorporateActionsStockSplits added in v1.7.0

func (sdk *SDK) GetCorporateActionsStockSplits(code string, opts ...adapt.Option) (*qotgetcorporateactionsstocksplits.S2C, error)

GetCorporateActionsStockSplits 3236 - gets the corporate actions stock splits.

code: security code

func (*SDK) GetCorporateActionsStockSplitsWithContext added in v1.7.0

func (sdk *SDK) GetCorporateActionsStockSplitsWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetcorporateactionsstocksplits.S2C, error)

GetCorporateActionsStockSplitsWithContext 3236 - gets the corporate actions stock splits with context.

code: security code

func (*SDK) GetDailyShortVolume added in v1.7.0

func (sdk *SDK) GetDailyShortVolume(code string, opts ...adapt.Option) (*qotgetdailyshortvolume.S2C, error)

GetDailyShortVolume 3248 - gets the daily short volume.

code: security code

func (*SDK) GetDailyShortVolumeWithContext added in v1.7.0

func (sdk *SDK) GetDailyShortVolumeWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetdailyshortvolume.S2C, error)

GetDailyShortVolumeWithContext 3248 - gets the daily short volume with context.

code: security code

func (*SDK) GetFinancialsEarningsPriceHistory added in v1.7.0

func (sdk *SDK) GetFinancialsEarningsPriceHistory(code string) (*qotgetfinancialsearnpricehist.S2C, error)

GetFinancialsEarningsPriceHistory 3226 - gets the financials earnings price history.

code: security code

func (*SDK) GetFinancialsEarningsPriceHistoryWithContext added in v1.7.0

func (sdk *SDK) GetFinancialsEarningsPriceHistoryWithContext(ctx context.Context, code string) (*qotgetfinancialsearnpricehist.S2C, error)

GetFinancialsEarningsPriceHistoryWithContext 3226 - gets the financials earnings price history with context.

code: security code

func (*SDK) GetFinancialsEarningsPriceMove added in v1.7.0

func (sdk *SDK) GetFinancialsEarningsPriceMove(code string, opts ...adapt.Option) (*qotgetfinancialsearnpricemove.S2C, error)

GetFinancialsEarningsPriceMove 3225 - gets the financials earnings price move.

code: security code

func (*SDK) GetFinancialsEarningsPriceMoveWithContext added in v1.7.0

func (sdk *SDK) GetFinancialsEarningsPriceMoveWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetfinancialsearnpricemove.S2C, error)

GetFinancialsEarningsPriceMoveWithContext 3225 - gets the financials earnings price move with context.

code: security code

func (*SDK) GetFinancialsRevenueBreakdown added in v1.7.0

func (sdk *SDK) GetFinancialsRevenueBreakdown(code string, opts ...adapt.Option) (*qotgetfinancialrevenuebreakdown.S2C, error)

GetFinancialsRevenueBreakdown 3228 - gets the financials revenue breakdown.

code: security code

func (*SDK) GetFinancialsRevenueBreakdownWithContext added in v1.7.0

func (sdk *SDK) GetFinancialsRevenueBreakdownWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetfinancialrevenuebreakdown.S2C, error)

GetFinancialsRevenueBreakdownWithContext 3228 - gets the financials revenue breakdown with context.

code: security code

func (*SDK) GetFinancialsStatements added in v1.7.0

func (sdk *SDK) GetFinancialsStatements(code string, statementType int32, opts ...adapt.Option) (*qotgetfinancialsstatements.S2C, error)

GetFinancialsStatements 3227 - gets the financial statements.

code: security code

statementType: financial statement type, see adapt.FinancialStatementsType_*

func (*SDK) GetFinancialsStatementsWithContext added in v1.7.0

func (sdk *SDK) GetFinancialsStatementsWithContext(ctx context.Context, code string, statementType int32, opts ...adapt.Option) (*qotgetfinancialsstatements.S2C, error)

GetFinancialsStatementsWithContext 3227 - gets the financial statements with context.

code: security code

statementType: financial statement type, see adapt.FinancialStatementsType_*

func (*SDK) GetFunds

func (sdk *SDK) GetFunds(header *trdcommon.TrdHeader, opts ...adapt.Option) (*trdcommon.Funds, error)

GetFunds 2101 - gets the funds.

func (*SDK) GetFundsWithContext

func (sdk *SDK) GetFundsWithContext(ctx context.Context, header *trdcommon.TrdHeader, opts ...adapt.Option) (*trdcommon.Funds, error)

GetFundsWithContext 2101 - gets the funds with context.

func (*SDK) GetFutureInfo

func (sdk *SDK) GetFutureInfo(codes []string) ([]*qotgetfutureinfo.FutureInfo, error)

GetFutureInfo 3218 - gets the future information.

codes: security codes

func (*SDK) GetFutureInfoWithContext

func (sdk *SDK) GetFutureInfoWithContext(ctx context.Context, codes []string) ([]*qotgetfutureinfo.FutureInfo, error)

GetFutureInfoWithContext 3218 - gets the future information with context.

codes: security codes

func (*SDK) GetGlobalState

func (sdk *SDK) GetGlobalState() (*getglobalstate.S2C, error)

GetGlobalState 1002 - gets the global state.

func (*SDK) GetGlobalStateWithContext

func (sdk *SDK) GetGlobalStateWithContext(ctx context.Context) (*getglobalstate.S2C, error)

GetGlobalStateWithContext 1002 - gets the global state with context.

func (*SDK) GetHistoryOrderFillList

func (sdk *SDK) GetHistoryOrderFillList(header *trdcommon.TrdHeader, fc *trdcommon.TrdFilterConditions, opts ...adapt.Option) ([]*trdcommon.OrderFill, error)

GetHistoryOrderFillList 2222 - gets the history filled order list.

func (*SDK) GetHistoryOrderFillListWithContext

func (sdk *SDK) GetHistoryOrderFillListWithContext(ctx context.Context, header *trdcommon.TrdHeader, fc *trdcommon.TrdFilterConditions, opts ...adapt.Option) ([]*trdcommon.OrderFill, error)

GetHistoryOrderFillListWithContext 2222 - gets the history filled order list with context.

func (*SDK) GetHistoryOrderList

func (sdk *SDK) GetHistoryOrderList(header *trdcommon.TrdHeader, fc *trdcommon.TrdFilterConditions, opts ...adapt.Option) ([]*trdcommon.Order, error)

GetHistoryOrderList 2221 - gets the history order list.

func (*SDK) GetHistoryOrderListWithContext

func (sdk *SDK) GetHistoryOrderListWithContext(ctx context.Context, header *trdcommon.TrdHeader, fc *trdcommon.TrdFilterConditions, opts ...adapt.Option) ([]*trdcommon.Order, error)

GetHistoryOrderListWithContext 2221 - gets the history order list with context.

func (*SDK) GetInsiderHolderList added in v1.7.0

func (sdk *SDK) GetInsiderHolderList(code string, opts ...adapt.Option) (*qotgetinsiderholderlist.S2C, error)

GetInsiderHolderList 3241 - gets the insider holder list.

code: security code

func (*SDK) GetInsiderHolderListWithContext added in v1.7.0

func (sdk *SDK) GetInsiderHolderListWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetinsiderholderlist.S2C, error)

GetInsiderHolderListWithContext 3241 - gets the insider holder list with context.

code: security code

func (*SDK) GetInsiderTradeList added in v1.7.0

func (sdk *SDK) GetInsiderTradeList(code string, opts ...adapt.Option) (*qotgetinsidertradelist.S2C, error)

GetInsiderTradeList 3242 - gets the insider trade list.

code: security code

func (*SDK) GetInsiderTradeListWithContext added in v1.7.0

func (sdk *SDK) GetInsiderTradeListWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetinsidertradelist.S2C, error)

GetInsiderTradeListWithContext 3242 - gets the insider trade list with context.

code: security code

func (*SDK) GetIpoList

func (sdk *SDK) GetIpoList(market int32) ([]*qotgetipolist.IpoData, error)

GetIpoList 3217 - gets the IPO list.

market: market

func (*SDK) GetIpoListWithContext

func (sdk *SDK) GetIpoListWithContext(ctx context.Context, market int32) ([]*qotgetipolist.IpoData, error)

GetIpoListWithContext 3217 - gets the IPO list with context.

market: market

func (*SDK) GetKL

func (sdk *SDK) GetKL(code string, klType int32, opts ...adapt.Option) (*qotgetkl.S2C, error)

GetKL 3006 - gets K-line data.

code: security code

klType: K-line type

func (*SDK) GetKLWithContext

func (sdk *SDK) GetKLWithContext(ctx context.Context, code string, klType int32, opts ...adapt.Option) (*qotgetkl.S2C, error)

GetKLWithContext 3006 - gets K-line data with context.

func (*SDK) GetMarginRatio

func (sdk *SDK) GetMarginRatio(header *trdcommon.TrdHeader, codes []string) ([]*trdgetmarginratio.MarginRatioInfo, error)

GetMarginRatio 2223 - gets the margin ratio.

func (*SDK) GetMarginRatioWithContext

func (sdk *SDK) GetMarginRatioWithContext(ctx context.Context, header *trdcommon.TrdHeader, codes []string) ([]*trdgetmarginratio.MarginRatioInfo, error)

GetMarginRatioWithContext 2223 - gets the margin ratio with context.

func (*SDK) GetMarketState

func (sdk *SDK) GetMarketState(codes []string) ([]*qotgetmarketstate.MarketInfo, error)

GetMarketState 3223 - gets the market state.

codes: security codes

func (*SDK) GetMarketStateWithContext

func (sdk *SDK) GetMarketStateWithContext(ctx context.Context, codes []string) ([]*qotgetmarketstate.MarketInfo, error)

GetMarketStateWithContext 3223 - gets the market state with context.

codes: security codes

func (*SDK) GetMaxTrdQtys

func (sdk *SDK) GetMaxTrdQtys(header *trdcommon.TrdHeader, orderType int32, code string, price float64, opts ...adapt.Option) (*trdcommon.MaxTrdQtys, error)

GetMaxTrdQtys 2111 - gets the maximum available trading quantities.

header: trading header

orderType: order type

code: security code, e.g. US.AAPL

price: price

func (*SDK) GetMaxTrdQtysWithContext

func (sdk *SDK) GetMaxTrdQtysWithContext(ctx context.Context, header *trdcommon.TrdHeader, orderType int32, code string, price float64, opts ...adapt.Option) (*trdcommon.MaxTrdQtys, error)

GetMaxTrdQtysWithContext 2111 - gets the maximum available trading quantities with context.

header: trading header

orderType: order type

code: security code, e.g. AAPL

price: price

func (*SDK) GetOpenOrderList

func (sdk *SDK) GetOpenOrderList(header *trdcommon.TrdHeader, opts ...adapt.Option) ([]*trdcommon.Order, error)

GetOpenOrderList 2201 - gets the open order list.

func (*SDK) GetOpenOrderListWithContext

func (sdk *SDK) GetOpenOrderListWithContext(ctx context.Context, header *trdcommon.TrdHeader, opts ...adapt.Option) ([]*trdcommon.Order, error)

GetOpenOrderListWithContext 2201 - gets the open order list with context.

func (*SDK) GetOptionChain

func (sdk *SDK) GetOptionChain(code string, beginTime string, endTime string, opts ...adapt.Option) ([]*qotgetoptionchain.OptionChain, error)

GetOptionChain 3209 - gets the option chain with context.

code: security code

beginTime: begin time, format: "yyyy-MM-dd"

endTime: end time, format: "yyyy-MM-dd"

func (*SDK) GetOptionChainWithContext

func (sdk *SDK) GetOptionChainWithContext(ctx context.Context, code string, beginTime string, endTime string, opts ...adapt.Option) ([]*qotgetoptionchain.OptionChain, error)

GetOptionChainWithContext 3209 - gets the option chain with context.

code: security code

beginTime: begin time, format: "yyyy-MM-dd"

endTime: end time, format: "yyyy-MM-dd"

func (*SDK) GetOptionExerciseProbability added in v1.7.0

func (sdk *SDK) GetOptionExerciseProbability(code string) (*qotgetoptionexerciseprobability.S2C, error)

GetOptionExerciseProbability 3251 - gets the option exercise probability.

code: security code

func (*SDK) GetOptionExerciseProbabilityWithContext added in v1.7.0

func (sdk *SDK) GetOptionExerciseProbabilityWithContext(ctx context.Context, code string) (*qotgetoptionexerciseprobability.S2C, error)

GetOptionExerciseProbabilityWithContext 3251 - gets the option exercise probability with context.

code: security code

func (*SDK) GetOptionExpirationDate

func (sdk *SDK) GetOptionExpirationDate(code string, opts ...adapt.Option) ([]*qotgetoptionexpirationdate.OptionExpirationDate, error)

GetOptionExpirationDate 3224 - gets the option expiration date.

code: security code

func (*SDK) GetOptionExpirationDateWithContext

func (sdk *SDK) GetOptionExpirationDateWithContext(ctx context.Context, code string, opts ...adapt.Option) ([]*qotgetoptionexpirationdate.OptionExpirationDate, error)

GetOptionExpirationDateWithContext 3224 - gets the option expiration date with context.

code: security code

func (*SDK) GetOptionVolatility added in v1.7.0

func (sdk *SDK) GetOptionVolatility(code string, opts ...adapt.Option) (*qotgetoptionvolatility.S2C, error)

GetOptionVolatility 3250 - gets the option volatility.

code: security code

func (*SDK) GetOptionVolatilityWithContext added in v1.7.0

func (sdk *SDK) GetOptionVolatilityWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetoptionvolatility.S2C, error)

GetOptionVolatilityWithContext 3250 - gets the option volatility with context.

code: security code

func (*SDK) GetOrderBook

func (sdk *SDK) GetOrderBook(code string, opts ...adapt.Option) (*qotgetorderbook.S2C, error)

GetOrderBook 3012 - gets order book data.

code: security code

func (*SDK) GetOrderBookWithContext

func (sdk *SDK) GetOrderBookWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetorderbook.S2C, error)

GetOrderBookWithContext 3012 - gets the order book with context.

code: security code

func (*SDK) GetOrderFee

func (sdk *SDK) GetOrderFee(header *trdcommon.TrdHeader, orderIdExList []string) ([]*trdcommon.OrderFee, error)

GetOrderFee 2225 - gets the order fee.

func (*SDK) GetOrderFeeWithContext

func (sdk *SDK) GetOrderFeeWithContext(ctx context.Context, header *trdcommon.TrdHeader, orderIdExList []string) ([]*trdcommon.OrderFee, error)

GetOrderFeeWithContext 2225 - gets the order fee with context.

func (*SDK) GetOrderFillList

func (sdk *SDK) GetOrderFillList(header *trdcommon.TrdHeader, opts ...adapt.Option) ([]*trdcommon.OrderFill, error)

GetOrderFillList 2211 - gets the filled order list.

func (*SDK) GetOrderFillListWithContext

func (sdk *SDK) GetOrderFillListWithContext(ctx context.Context, header *trdcommon.TrdHeader, opts ...adapt.Option) ([]*trdcommon.OrderFill, error)

GetOrderFillListWithContext 2211 - gets the filled order list with context.

func (*SDK) GetOwnerPlate

func (sdk *SDK) GetOwnerPlate(codes []string) ([]*qotgetownerplate.SecurityOwnerPlate, error)

GetOwnerPlate 3207 - gets the owner plate.

codes: security codes

func (*SDK) GetOwnerPlateWithContext

func (sdk *SDK) GetOwnerPlateWithContext(ctx context.Context, codes []string) ([]*qotgetownerplate.SecurityOwnerPlate, error)

GetOwnerPlateWithContext 3207 - gets the owner plate with context.

codes: security codes

func (*SDK) GetPlateSecurity

func (sdk *SDK) GetPlateSecurity(plateCode string, opts ...adapt.Option) ([]*qotcommon.SecurityStaticInfo, error)

GetPlateSecurity 3205 - gets the plate securities.

plateCode: plate code

func (*SDK) GetPlateSecurityWithContext

func (sdk *SDK) GetPlateSecurityWithContext(ctx context.Context, plateCode string, opts ...adapt.Option) ([]*qotcommon.SecurityStaticInfo, error)

GetPlateSecurityWithContext 3205 - gets the plate securities with context.

plateCode: plate code

func (*SDK) GetPlateSet

func (sdk *SDK) GetPlateSet(market int32, plateSetType int32) ([]*qotcommon.PlateInfo, error)

GetPlateSet 3204 - gets the plate set.

market: market

plateSetType: plate set type

func (*SDK) GetPlateSetWithContext

func (sdk *SDK) GetPlateSetWithContext(ctx context.Context, market int32, plateSetType int32) ([]*qotcommon.PlateInfo, error)

GetPlateSetWithContext 3204 - gets the plate set with context.

market: market

plateSetType: plate set type

func (*SDK) GetPositionList

func (sdk *SDK) GetPositionList(header *trdcommon.TrdHeader, opts ...adapt.Option) ([]*trdcommon.Position, error)

GetPositionList 2102 - gets the position list.

func (*SDK) GetPositionListWithContext

func (sdk *SDK) GetPositionListWithContext(ctx context.Context, header *trdcommon.TrdHeader, opts ...adapt.Option) ([]*trdcommon.Position, error)

GetPositionListWithContext 2102 - gets the position list with context.

func (*SDK) GetPriceReminder

func (sdk *SDK) GetPriceReminder(code string, market int32) ([]*qotgetpricereminder.PriceReminder, error)

GetPriceReminder 3221 - gets the price reminder.

code: security code

market: market, if security is set, this param is ignored

func (*SDK) GetPriceReminderWithContext

func (sdk *SDK) GetPriceReminderWithContext(ctx context.Context, code string, market int32) ([]*qotgetpricereminder.PriceReminder, error)

GetPriceReminderWithContext 3221 - gets the price reminder with context.

code: security code

market: market, if security is set, this param is ignored

func (*SDK) GetRT

func (sdk *SDK) GetRT(code string) (*qotgetrt.S2C, error)

GetRT 3008 - gets real-time data.

code: security code

func (*SDK) GetRTWithContext

func (sdk *SDK) GetRTWithContext(ctx context.Context, code string) (*qotgetrt.S2C, error)

GetRTWithContext 3008 - gets real-time data with context.

code: security code

func (*SDK) GetReference

func (sdk *SDK) GetReference(code string, refType int32) ([]*qotcommon.SecurityStaticInfo, error)

GetReference 3206 - gets the reference data.

code: security code

refType: reference type

func (*SDK) GetReferenceWithContext

func (sdk *SDK) GetReferenceWithContext(ctx context.Context, code string, refType int32) ([]*qotcommon.SecurityStaticInfo, error)

GetReferenceWithContext 3206 - gets the reference with context.

code: security code

refType: reference type

func (*SDK) GetResearchAnalystConsensus added in v1.7.0

func (sdk *SDK) GetResearchAnalystConsensus(code string) (*qotgetresearchanalystconsensus.S2C, error)

GetResearchAnalystConsensus 3229 - gets the research analyst consensus.

code: security code

func (*SDK) GetResearchAnalystConsensusWithContext added in v1.7.0

func (sdk *SDK) GetResearchAnalystConsensusWithContext(ctx context.Context, code string) (*qotgetresearchanalystconsensus.S2C, error)

GetResearchAnalystConsensusWithContext 3229 - gets the research analyst consensus with context.

code: security code

func (*SDK) GetResearchMorningstarReport added in v1.7.0

func (sdk *SDK) GetResearchMorningstarReport(code string) (*qotgetresearchmorningstarrpt.S2C, error)

GetResearchMorningstarReport 3231 - gets the research morningstar report.

code: security code

func (*SDK) GetResearchMorningstarReportWithContext added in v1.7.0

func (sdk *SDK) GetResearchMorningstarReportWithContext(ctx context.Context, code string) (*qotgetresearchmorningstarrpt.S2C, error)

GetResearchMorningstarReportWithContext 3231 - gets the research morningstar report with context.

code: security code

func (*SDK) GetResearchRatingSummary added in v1.7.0

func (sdk *SDK) GetResearchRatingSummary(code string, opts ...adapt.Option) (*qotgetresearchratingsummary.S2C, error)

GetResearchRatingSummary 3230 - gets the research rating summary.

code: security code

func (*SDK) GetResearchRatingSummaryWithContext added in v1.7.0

func (sdk *SDK) GetResearchRatingSummaryWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetresearchratingsummary.S2C, error)

GetResearchRatingSummaryWithContext 3230 - gets the research rating summary with context.

code: security code

func (*SDK) GetSecuritySnapshot

func (sdk *SDK) GetSecuritySnapshot(codes []string) ([]*qotgetsecuritysnapshot.Snapshot, error)

GetSecuritySnapshot 3203 - gets the security snapshot.

codes: security codes

func (*SDK) GetSecuritySnapshotWithContext

func (sdk *SDK) GetSecuritySnapshotWithContext(ctx context.Context, codes []string) ([]*qotgetsecuritysnapshot.Snapshot, error)

GetSecuritySnapshotWithContext 3203 - gets the security snapshot with context.

codes: security codes

func (*SDK) GetShareholdersHolderDetail added in v1.7.0

func (sdk *SDK) GetShareholdersHolderDetail(code string, opts ...adapt.Option) (*qotgetshareholdersholderdetail.S2C, error)

GetShareholdersHolderDetail 3239 - gets the shareholders holder detail.

code: security code

func (*SDK) GetShareholdersHolderDetailWithContext added in v1.7.0

func (sdk *SDK) GetShareholdersHolderDetailWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetshareholdersholderdetail.S2C, error)

GetShareholdersHolderDetailWithContext 3239 - gets the shareholders holder detail with context.

code: security code

func (*SDK) GetShareholdersHoldingChanges added in v1.7.0

func (sdk *SDK) GetShareholdersHoldingChanges(code string, opts ...adapt.Option) (*qotgetshareholdersholdingchanges.S2C, error)

GetShareholdersHoldingChanges 3238 - gets the shareholders holding changes.

code: security code

func (*SDK) GetShareholdersHoldingChangesWithContext added in v1.7.0

func (sdk *SDK) GetShareholdersHoldingChangesWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetshareholdersholdingchanges.S2C, error)

GetShareholdersHoldingChangesWithContext 3238 - gets the shareholders holding changes with context.

code: security code

func (*SDK) GetShareholdersInstitutional added in v1.7.0

func (sdk *SDK) GetShareholdersInstitutional(code string, opts ...adapt.Option) (*qotgetshareholdersinstitutional.S2C, error)

GetShareholdersInstitutional 3240 - gets the shareholders institutional.

code: security code

func (*SDK) GetShareholdersInstitutionalWithContext added in v1.7.0

func (sdk *SDK) GetShareholdersInstitutionalWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetshareholdersinstitutional.S2C, error)

GetShareholdersInstitutionalWithContext 3240 - gets the shareholders institutional with context.

code: security code

func (*SDK) GetShareholdersOverview added in v1.7.0

func (sdk *SDK) GetShareholdersOverview(code string, opts ...adapt.Option) (*qotgetshareholdersoverview.S2C, error)

GetShareholdersOverview 3237 - gets the shareholders overview.

code: security code

func (*SDK) GetShareholdersOverviewWithContext added in v1.7.0

func (sdk *SDK) GetShareholdersOverviewWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetshareholdersoverview.S2C, error)

GetShareholdersOverviewWithContext 3237 - gets the shareholders overview with context.

code: security code

func (*SDK) GetShortInterest added in v1.7.0

func (sdk *SDK) GetShortInterest(code string, opts ...adapt.Option) (*qotgetshortinterest.S2C, error)

GetShortInterest 3249 - gets the short interest.

code: security code

func (*SDK) GetShortInterestWithContext added in v1.7.0

func (sdk *SDK) GetShortInterestWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetshortinterest.S2C, error)

GetShortInterestWithContext 3249 - gets the short interest with context.

code: security code

func (*SDK) GetStaticInfo

func (sdk *SDK) GetStaticInfo(opts ...adapt.Option) ([]*qotcommon.SecurityStaticInfo, error)

GetStaticInfo 3202 - gets the static information.

func (*SDK) GetStaticInfoWithContext

func (sdk *SDK) GetStaticInfoWithContext(ctx context.Context, opts ...adapt.Option) ([]*qotcommon.SecurityStaticInfo, error)

GetStaticInfoWithContext 3202 - gets the static information with context.

func (*SDK) GetSubInfo

func (sdk *SDK) GetSubInfo(opts ...adapt.Option) (*qotgetsubinfo.S2C, error)

GetSubInfo 3003 - gets the subscription information.

func (*SDK) GetSubInfoWithContext

func (sdk *SDK) GetSubInfoWithContext(ctx context.Context, opts ...adapt.Option) (*qotgetsubinfo.S2C, error)

GetSubInfoWithContext 3003 - gets the subscription information with context.

func (*SDK) GetTicker

func (sdk *SDK) GetTicker(code string, opts ...adapt.Option) (*qotgetticker.S2C, error)

GetTicker 3010 - gets ticker data.

code: security code

func (*SDK) GetTickerWithContext

func (sdk *SDK) GetTickerWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgetticker.S2C, error)

GetTickerWithContext 3010 - gets the ticker data with context.

code: security code

func (*SDK) GetTopTenBuySellBrokers added in v1.7.0

func (sdk *SDK) GetTopTenBuySellBrokers(code string, opts ...adapt.Option) (*qotgettoptenbuysellbrokers.S2C, error)

GetTopTenBuySellBrokers 3247 - gets the top ten buy/sell brokers.

code: security code

func (*SDK) GetTopTenBuySellBrokersWithContext added in v1.7.0

func (sdk *SDK) GetTopTenBuySellBrokersWithContext(ctx context.Context, code string, opts ...adapt.Option) (*qotgettoptenbuysellbrokers.S2C, error)

GetTopTenBuySellBrokersWithContext 3247 - gets the top ten buy/sell brokers with context.

code: security code

func (*SDK) GetUserSecurity

func (sdk *SDK) GetUserSecurity(groupName string) ([]*qotcommon.SecurityStaticInfo, error)

GetUserSecurity 3213 - gets the user security.

groupName: group name

func (*SDK) GetUserSecurityGroup

func (sdk *SDK) GetUserSecurityGroup(groupType int32) ([]*qotgetusersecuritygroup.GroupData, error)

GetUserSecurityGroup 3222 - gets the user security group.

groupType: group type

func (*SDK) GetUserSecurityGroupWithContext

func (sdk *SDK) GetUserSecurityGroupWithContext(ctx context.Context, groupType int32) ([]*qotgetusersecuritygroup.GroupData, error)

GetUserSecurityGroupWithContext 3222 - gets the user security group with context.

groupType: group type

func (*SDK) GetUserSecurityWithContext

func (sdk *SDK) GetUserSecurityWithContext(ctx context.Context, groupName string) ([]*qotcommon.SecurityStaticInfo, error)

GetUserSecurityWithContext 3213 - gets the user security with context.

groupName: group name

func (*SDK) GetValuationDetail added in v1.7.0

func (sdk *SDK) GetValuationDetail(code string, valuationType int32, opts ...adapt.Option) (*qotgetvaluationdetail.S2C, error)

GetValuationDetail 3232 - gets the valuation detail.

code: security code

valuationType: valuation type, see adapt.ValuationType_*

func (*SDK) GetValuationDetailWithContext added in v1.7.0

func (sdk *SDK) GetValuationDetailWithContext(ctx context.Context, code string, valuationType int32, opts ...adapt.Option) (*qotgetvaluationdetail.S2C, error)

GetValuationDetailWithContext 3232 - gets the valuation detail with context.

code: security code

valuationType: valuation type, see adapt.ValuationType_*

func (*SDK) GetValuationPlateStockList added in v1.7.0

func (sdk *SDK) GetValuationPlateStockList(code string, valuationType int32, opts ...adapt.Option) (*qotgetvaluationplatestocklist.S2C, error)

GetValuationPlateStockList 3233 - gets the valuation plate stock list.

code: security code (plate code)

valuationType: valuation type, see adapt.ValuationType_*

func (*SDK) GetValuationPlateStockListWithContext added in v1.7.0

func (sdk *SDK) GetValuationPlateStockListWithContext(ctx context.Context, code string, valuationType int32, opts ...adapt.Option) (*qotgetvaluationplatestocklist.S2C, error)

GetValuationPlateStockListWithContext 3233 - gets the valuation plate stock list with context.

code: security code (plate code)

valuationType: valuation type, see adapt.ValuationType_*

func (*SDK) GetWarrant

func (sdk *SDK) GetWarrant(begin int32, num int32, opts ...adapt.Option) (*qotgetwarrant.S2C, error)

GetWarrant 3210 - gets the warrant, only available in Hong Kong market. Sort by score in descending order by default.

begin: begin index

num: number of warrants

func (*SDK) GetWarrantWithContext

func (sdk *SDK) GetWarrantWithContext(ctx context.Context, begin int32, num int32, opts ...adapt.Option) (*qotgetwarrant.S2C, error)

GetWarrantWithContext 3210 - gets the warrant with context, only available in Hong Kong market. Sort by score in descending order by default.

begin: begin index

num: number of warrants

func (*SDK) ModifyOrder

func (sdk *SDK) ModifyOrder(header *trdcommon.TrdHeader, orderID uint64, modifyOrderOp int32, opts ...adapt.Option) (*trdmodifyorder.S2C, error)

ModifyOrder 2205 - modifies an order with context.

header: trading header

orderID: order ID, use 0 if forAll=true

modifyOrderOp: modify order operation

func (*SDK) ModifyOrderWithContext

func (sdk *SDK) ModifyOrderWithContext(ctx context.Context, header *trdcommon.TrdHeader, orderID uint64, modifyOrderOp int32, opts ...adapt.Option) (*trdmodifyorder.S2C, error)

ModifyOrderWithContext 2205 - modifies an order with context.

header: trading header

orderID: order ID, use 0 if forAll=true

modifyOrderOp: modify order operation

func (*SDK) ModifyUserSecurity

func (sdk *SDK) ModifyUserSecurity(groupName string, codes []string, op int32) error

ModifyUserSecurity 3214 - modifies the user security.

groupName: group name

codes: security codes

op: operation, 1 for add, 2 for delete

func (*SDK) ModifyUserSecurityWithContext

func (sdk *SDK) ModifyUserSecurityWithContext(ctx context.Context, groupName string, codes []string, op int32) error

ModifyUserSecurityWithContext 3214 - modifies the user security with context.

groupName: group name

codes: security codes

op: operation

func (*SDK) OptionScreen added in v1.7.0

func (sdk *SDK) OptionScreen(opts ...adapt.Option) (*qotoptionscreen.S2C, error)

OptionScreen 3253 - option screen.

func (*SDK) OptionScreenWithContext added in v1.7.0

func (sdk *SDK) OptionScreenWithContext(ctx context.Context, opts ...adapt.Option) (*qotoptionscreen.S2C, error)

OptionScreenWithContext 3253 - option screen with context.

func (*SDK) PlaceOrder

func (sdk *SDK) PlaceOrder(header *trdcommon.TrdHeader, trdSide int32, orderType int32, code string, qty float64, price float64, opts ...adapt.Option) (*trdplaceorder.S2C, error)

PlaceOrder 2202 - places an order.

header: trading header

trdSide: trading side

orderType: order type

code: security code, e.g. US.AAPL

qty: quantity

price: price

func (*SDK) PlaceOrderWithContext

func (sdk *SDK) PlaceOrderWithContext(ctx context.Context, header *trdcommon.TrdHeader, trdSide int32, orderType int32, code string, qty float64, price float64, opts ...adapt.Option) (*trdplaceorder.S2C, error)

PlaceOrderWithContext 2202 - places an order with context.

header: trading header

trdSide: trading side

orderType: order type

code: security code, e.g. US.AAPL

qty: quantity

price: price

func (*SDK) RegisterHandler

func (sdk *SDK) RegisterHandler(protoID uint32, h client.Handler) *SDK

RegisterHandler registers a handler for notifications of a specified protoID.

func (*SDK) RequestHistoryKL

func (sdk *SDK) RequestHistoryKL(code string, klType int32, beginTime string, endTime string, opts ...adapt.Option) (*qotrequesthistorykl.S2C, error)

RequestHistoryKL 3103 - requests the history K-line data.

code: security code

klType: K-line type

beginTime: begin time, format: "yyyy-MM-dd"

endTime: end time, format: "yyyy-MM-dd"

func (*SDK) RequestHistoryKLQuota

func (sdk *SDK) RequestHistoryKLQuota(opts ...adapt.Option) (*qotrequesthistoryklquota.S2C, error)

RequestHistoryKLQuota 3104 - requests the history K-line quota.

func (*SDK) RequestHistoryKLQuotaWithContext

func (sdk *SDK) RequestHistoryKLQuotaWithContext(ctx context.Context, opts ...adapt.Option) (*qotrequesthistoryklquota.S2C, error)

RequestHistoryKLQuotaWithContext 3104 - requests the history K-line quota with context.

func (*SDK) RequestHistoryKLWithContext

func (sdk *SDK) RequestHistoryKLWithContext(ctx context.Context, code string, klType int32, beginTime string, endTime string, opts ...adapt.Option) (*qotrequesthistorykl.S2C, error)

RequestHistoryKLWithContext 3103 - requests the history K-line data with context.

code: security code

klType: K-line type

beginTime: begin time, format: "yyyy-MM-dd"

endTime: end time, format: "yyyy-MM-dd"

func (*SDK) RequestRehab

func (sdk *SDK) RequestRehab(code string) (*qotrequestrehab.S2C, error)

RequestRehab 3105 - requests the rehab data.

func (*SDK) RequestRehabWithContext

func (sdk *SDK) RequestRehabWithContext(ctx context.Context, code string) (*qotrequestrehab.S2C, error)

RequestRehabWithContext 3105 - requests the rehab data with context.

code: security code

func (*SDK) RequestTradeDate

func (sdk *SDK) RequestTradeDate(market int32, code string, beginTime string, endTime string) ([]*qotrequesttradedate.TradeDate, error)

RequestTradeDate 3219 - requests the trade date.

market: market

code: security code

beginTime: begin time, format: "yyyy-MM-dd"

endTime: end time, format: "yyyy-MM-dd"

func (*SDK) RequestTradeDateWithContext

func (sdk *SDK) RequestTradeDateWithContext(ctx context.Context, market int32, code string, beginTime string, endTime string) ([]*qotrequesttradedate.TradeDate, error)

RequestTradeDateWithContext 3219 - requests the trade date with context.

market: market

code: security code

beginTime: begin time, format: "yyyy-MM-dd"

endTime: end time, format: "yyyy-MM-dd"

func (*SDK) SetPriceReminder

func (sdk *SDK) SetPriceReminder(code string, op int32, opts ...adapt.Option) (int64, error)

SetPriceReminder 3220 - sets the price reminder.

code: security code

op: operation, 1 for add, 2 for delete

func (*SDK) SetPriceReminderWithContext

func (sdk *SDK) SetPriceReminderWithContext(ctx context.Context, code string, op int32, opts ...adapt.Option) (int64, error)

SetPriceReminderWithContext 3220 - sets the price reminder with context.

code: security code

op: operation

func (*SDK) StockFilter

func (sdk *SDK) StockFilter(market int32, opts ...adapt.Option) (*qotstockfilter.S2C, error)

StockFilter 3215 - filters the stocks.

market: market

func (*SDK) StockFilterWithContext

func (sdk *SDK) StockFilterWithContext(ctx context.Context, market int32, opts ...adapt.Option) (*qotstockfilter.S2C, error)

StockFilterWithContext 3215 - filters the stock with context.

market: market

func (*SDK) StockScreen added in v1.7.0

func (sdk *SDK) StockScreen(opts ...adapt.Option) (*qotstockscreen.S2C, error)

StockScreen 3252 - stock screen.

func (*SDK) StockScreenWithContext added in v1.7.0

func (sdk *SDK) StockScreenWithContext(ctx context.Context, opts ...adapt.Option) (*qotstockscreen.S2C, error)

StockScreenWithContext 3252 - stock screen with context.

func (*SDK) Subscribe

func (sdk *SDK) Subscribe(codes []string, subTypes []int32, isSub bool, opts ...adapt.Option) error

Subscribe 3001 - subscribes or unsubscribes.

codes: security codes

subTypes: subscription types

isSub: true for subscribe, false for unsubscribe

func (*SDK) SubscribeAccPush

func (sdk *SDK) SubscribeAccPush(accIDList []uint64) error

SubscribeAccPush 2008 - subscribes the trading account push data.

accIDList: account ID list

func (*SDK) SubscribeAccPushWithContext

func (sdk *SDK) SubscribeAccPushWithContext(ctx context.Context, accIDList []uint64) error

SubscribeAccPushWithContext 2008 - subscribes the trading account push data.

accIDList: account ID list

func (*SDK) SubscribeWithContext

func (sdk *SDK) SubscribeWithContext(ctx context.Context, codes []string, subTypes []int32, isSub bool, opts ...adapt.Option) error

SubscribeWithContext 3001 - subscribes or unsubscribes with context.

codes: security codes

subTypes: subscription types

isSub: true for subscribe, false for unsubscribe

func (*SDK) TrdFlowSummary added in v1.3.0

func (sdk *SDK) TrdFlowSummary(header *trdcommon.TrdHeader, clearingDate string) ([]*trdflowsummary.FlowSummaryInfo, error)

TrdFlowSummary 2226 - gets the trading flow summary.

func (*SDK) TrdFlowSummaryWithContext added in v1.3.0

func (sdk *SDK) TrdFlowSummaryWithContext(ctx context.Context, header *trdcommon.TrdHeader, clearingDate string) ([]*trdflowsummary.FlowSummaryInfo, error)

TrdFlowSummaryWithContext 2226 - gets the trading flow summary with context.

func (*SDK) UnlockTrade

func (sdk *SDK) UnlockTrade(unlock bool, pwdMD5 string, securityFirm int32) error

UnlockTrade 2005 - unlocks or locks the trade.

unlock: true for unlock, false for lock

pwdMD5: MD5 of the password

securityFirm: security firm

func (*SDK) UnlockTradeWithContext

func (sdk *SDK) UnlockTradeWithContext(ctx context.Context, unlock bool, pwdMD5 string, securityFirm int32) error

UnlockTrade 2005 - unlocks or locks the trade.

unlock: true for unlock, false for lock

pwdMD5: MD5 of the password

securityFirm: security firm

func (*SDK) WarrantScreen added in v1.7.0

func (sdk *SDK) WarrantScreen(opts ...adapt.Option) (*qotwarrantscreen.S2C, error)

WarrantScreen 3254 - warrant screen.

func (*SDK) WarrantScreenWithContext added in v1.7.0

func (sdk *SDK) WarrantScreenWithContext(ctx context.Context, opts ...adapt.Option) (*qotwarrantscreen.S2C, error)

WarrantScreenWithContext 3254 - warrant screen with context.

Directories

Path Synopsis
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL