Documentation ¶
Index ¶
- type Adapter
- type DemoEnv
- func (e *DemoEnv) CancelDemoOrder(req *hubpb.ReqCancelOrder) error
- func (e *DemoEnv) CheckDemoTrade(mds *pb.MarketDataSnapshot)
- func (e *DemoEnv) CurrentDemoOrderList() []hubpb.DemoOrder
- func (e *DemoEnv) InsertDemoOrder(req *hubpb.ReqInsertOrder) error
- func (e *DemoEnv) PushTick(rtn *pb.MarketDataSnapshot)
- type DemoEnvOptions
- type Packet
- type Subscriber
- type SyncAdapter
- type SyncPool
- type SyncPoolOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter ctp socket adapter
func NewAdapter ¶
NewAdapter create new adapter
type DemoEnv ¶
type DemoEnv struct {
// contains filtered or unexported fields
}
DemoEnv DemoEnv
func (*DemoEnv) CancelDemoOrder ¶
func (e *DemoEnv) CancelDemoOrder(req *hubpb.ReqCancelOrder) error
CancelDemoOrder cancel demo order
func (*DemoEnv) CheckDemoTrade ¶
func (e *DemoEnv) CheckDemoTrade(mds *pb.MarketDataSnapshot)
CheckDemoTrade 检查成交
func (*DemoEnv) CurrentDemoOrderList ¶
CurrentDemoOrderList do list
func (*DemoEnv) InsertDemoOrder ¶
func (e *DemoEnv) InsertDemoOrder(req *hubpb.ReqInsertOrder) error
InsertDemoOrder 发送模拟
type DemoEnvOptions ¶
type DemoEnvOptions struct { GetUID func() string OnDemoOrder func(*hubpb.DemoOrder) OnDemoTrade func(*pb.Trade) GetInstrument func(string) *pb.Instrument }
DemoEnvOptions oiptions
type Packet ¶
type Packet struct { MsgType int32 RequestID int32 IsLast int32 BodyLength int32 BodyList [][]byte }
Packet pkt
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber subscribe tick 订阅,退订,和断线重连(重订)
func NewSubscriber ¶
func NewSubscriber(host, account, password string, fronts []string, timeout time.Duration, onTick func(*ctp.CThostFtdcDepthMarketDataField)) (*Subscriber, error)
NewSubscriber create subscriber
func (*Subscriber) Subscribe ¶
func (s *Subscriber) Subscribe(exchange, symbol string) error
Subscribe quote
func (*Subscriber) UnSubscribe ¶
func (s *Subscriber) UnSubscribe(exchange, symbol string) error
UnSubscribe un sub
type SyncAdapter ¶
type SyncAdapter struct { Data interface{} // contains filtered or unexported fields }
SyncAdapter sync
func NewSyncAdapter ¶
func NewSyncAdapter(host string, timeout time.Duration, fronts []string, h func(*Packet)) (*SyncAdapter, error)
NewSyncAdapter create new sync adapter
type SyncPool ¶
type SyncPool struct {
// contains filtered or unexported fields
}
SyncPool as pool
func (*SyncPool) GetAdapter ¶
func (p *SyncPool) GetAdapter(brokerID, account string) (*SyncAdapter, error)
GetAdapter get adapter from pool
type SyncPoolOptions ¶
type SyncPoolOptions struct {
NewSyncAdapter func(brokerID, account string) (*SyncAdapter, error)
}
SyncPoolOptions options
Click to show internal directories.
Click to hide internal directories.