Documentation ¶
Index ¶
- func ConvertByte2String(byte []byte, charset string) string
- type Quote
- func (q *Quote) RegOnFrontConnected(on goctp.OnFrontConnectedType)
- func (q *Quote) RegOnFrontDisConnected(on goctp.OnFrontDisConnectedType)
- func (q *Quote) RegOnRspUserLogin(on goctp.OnRspUserLoginType)
- func (q *Quote) RegOnTick(on goctp.OnTickType)
- func (q *Quote) Release()
- func (q *Quote) ReqConnect(addr string)
- func (q *Quote) ReqLogin(investor, pwd, broker string)
- func (q *Quote) ReqSubscript(instrument string)
- type Trade
- func (t *Trade) RegOnErrAction(on goctp.OnRtnErrActionType)
- func (t *Trade) RegOnErrRtnOrder(on goctp.OnRtnErrOrderType)
- func (t *Trade) RegOnFrontConnected(on goctp.OnFrontConnectedType)
- func (t *Trade) RegOnFrontDisConnected(on goctp.OnFrontDisConnectedType)
- func (t *Trade) RegOnRspUserLogin(on goctp.OnRspUserLoginType)
- func (t *Trade) RegOnRtnAccount(on goctp.OnRtnAccountType)
- func (t *Trade) RegOnRtnCancel(on goctp.OnRtnOrderType)
- func (t *Trade) RegOnRtnFromBankToFuture(on goctp.OnRtnFromBankToFutureByFuture)
- func (t *Trade) RegOnRtnFromFutureToBank(on goctp.OnRtnFromFutureToBankByFuture)
- func (t *Trade) RegOnRtnInstrument(on goctp.OnRtnInstrumentType)
- func (t *Trade) RegOnRtnInstrumentStatus(on goctp.OnRtnInstrumentStatusType)
- func (t *Trade) RegOnRtnOrder(on goctp.OnRtnOrderType)
- func (t *Trade) RegOnRtnPosition(on goctp.OnRtnPositionType)
- func (t *Trade) RegOnRtnTrade(on goctp.OnRtnTradeType)
- func (t *Trade) Release()
- func (t *Trade) ReqBankToFuture(bankID, bankAccount, bankPwd string, amount float64)
- func (t *Trade) ReqConnect(addr string)
- func (t *Trade) ReqFutureToBank(bankID, bankAccount string, amount float64)
- func (t *Trade) ReqLogin(investor, pwd, broker, appID, authCode string)
- func (t *Trade) ReqOrderAction(orderID string) int
- func (t *Trade) ReqOrderInsert(requestid int32, ordersn string, instrument string, ...) string
- func (t *Trade) ReqOrderInsertFAK(requestid int32, ordersn string, instrument string, ...) string
- func (t *Trade) ReqOrderInsertFOK(requestid int32, ordersn string, instrument string, ...) string
- func (t *Trade) ReqOrderInsertMarket(requestid int32, ordersn string, instrument string, ...) string
- func (t *Trade) ReqQueryInstrument() int
- func (t *Trade) ReqQueryInvestorPosition() int
- func (t *Trade) ReqQueryTradingAccount() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertByte2String ¶ added in v1.10.0
转换中文
Types ¶
type Quote ¶
type Quote struct { // 帐号 InvestorID string // 经纪商 BrokerID string // contains filtered or unexported fields }
Quote 行情接口
func (*Quote) RegOnFrontConnected ¶
func (q *Quote) RegOnFrontConnected(on goctp.OnFrontConnectedType)
RegOnFrontConnected 注册前置响应
func (*Quote) RegOnFrontDisConnected ¶
func (q *Quote) RegOnFrontDisConnected(on goctp.OnFrontDisConnectedType)
RegOnFrontDisConnected 注册连接响应
func (*Quote) RegOnRspUserLogin ¶
func (q *Quote) RegOnRspUserLogin(on goctp.OnRspUserLoginType)
RegOnRspUserLogin 注册登录响应
func (*Quote) ReqConnect ¶
ReqConnect 连接前置;Join阻塞,请用goroutine
type Trade ¶
type Trade struct { InvestorID string // 帐号 BrokerID string // 经纪商 TradingDay string // 交易日 Instruments sync.Map // 合约列表 InstrumentStatus sync.Map // 合约状态 Positions sync.Map // 持仓列表 Orders sync.Map // 委托 Trades sync.Map // 成交 Account *goctp.AccountField // 帐户权益 IsLogin bool // 登录成功 // contains filtered or unexported fields }
Trade 交易接口
func (*Trade) RegOnErrAction ¶
func (t *Trade) RegOnErrAction(on goctp.OnRtnErrActionType)
RegOnErrAction 注册撤单响应
func (*Trade) RegOnErrRtnOrder ¶
func (t *Trade) RegOnErrRtnOrder(on goctp.OnRtnErrOrderType)
RegOnErrRtnOrder 注册委托响应
func (*Trade) RegOnFrontConnected ¶
func (t *Trade) RegOnFrontConnected(on goctp.OnFrontConnectedType)
RegOnFrontConnected 注册连接响应
func (*Trade) RegOnFrontDisConnected ¶
func (t *Trade) RegOnFrontDisConnected(on goctp.OnFrontDisConnectedType)
RegOnFrontDisConnected 注册连接响应
func (*Trade) RegOnRspUserLogin ¶
func (t *Trade) RegOnRspUserLogin(on goctp.OnRspUserLoginType)
RegOnRspUserLogin 注册登陆响应
func (*Trade) RegOnRtnAccount ¶ added in v1.12.6
func (t *Trade) RegOnRtnAccount(on goctp.OnRtnAccountType)
注册账户权益变化
func (*Trade) RegOnRtnCancel ¶
func (t *Trade) RegOnRtnCancel(on goctp.OnRtnOrderType)
RegOnRtnCancel 注册撤单响应
func (*Trade) RegOnRtnFromBankToFuture ¶
func (t *Trade) RegOnRtnFromBankToFuture(on goctp.OnRtnFromBankToFutureByFuture)
func (*Trade) RegOnRtnFromFutureToBank ¶
func (t *Trade) RegOnRtnFromFutureToBank(on goctp.OnRtnFromFutureToBankByFuture)
func (*Trade) RegOnRtnInstrument ¶ added in v1.15.0
func (t *Trade) RegOnRtnInstrument(on goctp.OnRtnInstrumentType)
RegOnRtnInstrument 注册合约变化
func (*Trade) RegOnRtnInstrumentStatus ¶
func (t *Trade) RegOnRtnInstrumentStatus(on goctp.OnRtnInstrumentStatusType)
RegOnRtnInstrumentStatus 注册合约状态变化
func (*Trade) RegOnRtnOrder ¶
func (t *Trade) RegOnRtnOrder(on goctp.OnRtnOrderType)
RegOnRtnOrder 注册委托响应
func (*Trade) RegOnRtnPosition ¶ added in v1.9.11
func (t *Trade) RegOnRtnPosition(on goctp.OnRtnPositionType)
RegOnRtnPosition 注册合约持仓变化
func (*Trade) RegOnRtnTrade ¶
func (t *Trade) RegOnRtnTrade(on goctp.OnRtnTradeType)
RegOnRtnTrade 注册成交响应
func (*Trade) ReqBankToFuture ¶
ReqBankToFuture 银行转期货
func (*Trade) ReqFutureToBank ¶
ReqFutureToBank 期货转银行
func (*Trade) ReqOrderInsert ¶
func (t *Trade) ReqOrderInsert(requestid int32, ordersn string, instrument string, buySell goctp.DirectionType, openClose goctp.OffsetFlagType, price float64, volume int) string
ReqOrderInsert 限价委托
func (*Trade) ReqOrderInsertFAK ¶
func (t *Trade) ReqOrderInsertFAK(requestid int32, ordersn string, instrument string, buySell goctp.DirectionType, openClose goctp.OffsetFlagType, price float64, volume int) string
ReqOrderInsertFAK FAK委托[全成or撤单]
func (*Trade) ReqOrderInsertFOK ¶
func (t *Trade) ReqOrderInsertFOK(requestid int32, ordersn string, instrument string, buySell goctp.DirectionType, openClose goctp.OffsetFlagType, price float64, volume int) string
ReqOrderInsertFOK FOK委托[部成撤单]
func (*Trade) ReqOrderInsertMarket ¶
func (t *Trade) ReqOrderInsertMarket(requestid int32, ordersn string, instrument string, buySell goctp.DirectionType, openClose goctp.OffsetFlagType, volume int) string
ReqOrderInsertMarket 市价委托
func (*Trade) ReqQueryInstrument ¶ added in v1.15.0
ReqQryInstrument 查询合约信息
func (*Trade) ReqQueryInvestorPosition ¶ added in v1.12.5
ReqQueryInvestorPosition 查询持仓
func (*Trade) ReqQueryTradingAccount ¶ added in v1.12.6
ReqQryTradingAccount 查询账户权益