shfe

package
v0.0.0-...-cd37182 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2Float64

func Bytes2Float64(b []byte) float64

func Bytes2String

func Bytes2String(b []byte) string

func DecodeGenericField

func DecodeGenericField(pkt []byte) ([]byte, int16, error)

func MIRPDecodeAndSink

func MIRPDecodeAndSink(data []byte, ds chan *sink.DataStream, ts time.Time, hpt *exats.HPT, src, dst string)

Types

type CenterChangeField

type CenterChangeField struct {
	ChangeNo int8
	SnapNo   int32
	PacketNo int32
}

func DecodeMDQPCenterChangeField

func DecodeMDQPCenterChangeField(pkt []byte) *CenterChangeField

type IncrRequest

type IncrRequest struct {
	TopicID    int16
	StartPktNo int32
	EndPktNo   int32
}

func DecodeIncrRequest

func DecodeIncrRequest(pkt []byte) (*IncrRequest, error)

type IncrResponse

type IncrResponse struct {
	Data []*MirpMsg
}

func DecodeIncrResponse

func DecodeIncrResponse(pkt []byte) (*IncrResponse, error)

type InstrData

type InstrData struct {
	InstrID            string
	UnderlyingInstrID  string
	ProductClass       string
	StrikePrice        float64
	OptionsType        string
	VolMul             int32
	UnderlyingMul      float64
	IsTrading          int32
	CurrencyID         string
	PriceTick          float64
	CodecPrice         float64
	InstrNo            int32
	LastPrice          float64
	Volume             int32
	Turnover           float64
	OpenInterest       float64
	HighestPrice       float64
	LowestPrice        float64
	OpenPrice          float64
	ClosePrice         float64
	SettlementPrice    float64
	UpperLimitPrice    float64
	LowerLimitPrice    float64
	PreSettlementPrice float64
	PreClosePrice      float64
	PreOpenInterest    float64
	PreDelta           float64
	CurrDelta          float64
	ActionDay          string
	UpdateTime         string
	UpdateMilliSec     int32
	ChangeNo           int32
	PV                 []*InstrPV
}

type InstrPV

type InstrPV struct {
	Direction string
	Price     float64
	Volume    int32
}

type LoginRequest

type LoginRequest struct {
	UserID               string
	ParticipantID        string
	Password             string
	Language             string
	UserProductInfo      string
	InterfaceProductInfo string
}

func DecodeLoginRequest

func DecodeLoginRequest(pkt []byte) (*LoginRequest, error)

type LoginResponse

type LoginResponse struct {
	ErrID             int32
	ErrMsg            string
	TradingDay        string
	LoginTime         string
	UserID            string
	ParticipantID     string
	TradingSystemName string
	ActionDay         string
}

func DecodeLoginResponse

func DecodeLoginResponse(pkt []byte) (*LoginResponse, error)

type LogoutRequest

type LogoutRequest struct {
	UserID        string
	ParticipantID string
}

func DecodeLogoutRequest

func DecodeLogoutRequest(pkt []byte) (*LogoutRequest, error)

type LogoutResponse

type LogoutResponse struct {
	ErrID         int32
	ErrMsg        string
	UserID        string
	ParticipantID string
}

func DecodeLogoutResponse

func DecodeLogoutResponse(pkt []byte) (*LogoutResponse, error)

type MDQPDecoder

type MDQPDecoder struct {
	StreamFactory *tcpStreamFactory

	Assembler *tcpassembly.Assembler
	// contains filtered or unexported fields
}

func NewMDQPDecoder

func NewMDQPDecoder(ch chan *sink.DataStream) *MDQPDecoder

type MDQPField

type MDQPField struct {
	ID    int16
	Name  string
	Size  int16
	Value interface{}
}

type MDQPHdr

type MDQPHdr struct {
	Version   uint8
	EndOfMsg  uint8
	TypeID    uint8
	Length    uint16
	RequestID int32
}

type MDQPMsg

type MDQPMsg struct {
	Hdr  *MDQPHdr
	Name string
	Data interface{}
}

func DecodeMDQP

func DecodeMDQP(pkt []byte) (*MDQPMsg, error)

type MIRPField

type MIRPField struct {
	ID    int16
	Name  string
	Size  int16
	Value interface{}
}

func DecodeMIRPField

func DecodeMIRPField(pkt []byte) *MIRPField

type MIRPInstrumentInfo

type MIRPInstrumentInfo struct {
	Code     int64
	ChangeNo int64
}

func DecodeMIRPInstrumentInfo

func DecodeMIRPInstrumentInfo(data []byte) *MIRPInstrumentInfo

type MIRPPriceChangeEvent

type MIRPPriceChangeEvent struct {
	EventType   string
	MDEntryType string
	PriceLevel  int64
	PriceOffset int64
	Volume      int64
}

func DecodeMIRPPriceChangeEvent

func DecodeMIRPPriceChangeEvent(data []byte) *MIRPPriceChangeEvent

type MIRPVolumeChangeEvent

type MIRPVolumeChangeEvent struct {
	LastPriceOffset    int64
	MIRPVolumeChange   int64
	TurnoverOffset     int64
	OpenInterestChange int64
}

func DecodeMIRPVolumeChangeEvent

func DecodeMIRPVolumeChangeEvent(data []byte) *MIRPVolumeChangeEvent

type MirpHdr

type MirpHdr struct {
	Flag           uint8
	TypeID         uint8
	Length         uint16
	PacketNo       int32
	TopicID        int16
	SnapMillisec   uint16
	SnapNo         int32
	SnapTime       uint32
	CommPhaseNo    uint16
	CenterChangeNo int8
}

type MirpMsg

type MirpMsg struct {
	Hdr  *MirpHdr
	Data []*MIRPField
}

func DecodeMIRP

func DecodeMIRP(pkt []byte) (*MirpMsg, error)

type SnapshotRequest

type SnapshotRequest struct {
	TopicID int16
	SnapNo  int32
}

func DecodeSnapshotRequest

func DecodeSnapshotRequest(pkt []byte) (*SnapshotRequest, error)

type SnapshotResponse

type SnapshotResponse struct {
	CenterChange []*CenterChangeField
	Hdr          *SnapshotResponseHdr
	InstrData    map[int32]*InstrData
}

func DecodeSnapshotResponse

func DecodeSnapshotResponse(pkt []byte) (*SnapshotResponse, error)

func (*SnapshotResponse) DecodeMDQPField

func (s *SnapshotResponse) DecodeMDQPField(pkt []byte) (int16, error)

type SnapshotResponseHdr

type SnapshotResponseHdr struct {
	TopicID           int16
	SnapNo            int32
	TradingDay        string
	SettlementGroupID string
	SettlementID      int32
	//0x1003
	MarketDataDepth int32
	CipherAlgorithm string
	CipherKey       [16]byte
	CipherIV        [16]byte
	//0x1002
	SnapDate     string
	SnapTime     string
	SnapMillisec int32
	//0x1004
	PacketNo int32
}

Jump to

Keyboard shortcuts

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