entity

package
v0.0.0-...-c68f7f2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 10 Imported by: 3

Documentation

Overview

Package entity is a generated protocol buffer package.

It is generated from these files:

entity.proto

It has these top-level messages:

ProtoRecord
ProtoTick

Index

Constants

View Source
const (
	TICK_SIDE_UNKNOWN = iota
	TICK_SIDE_BUY
	TICK_SIDE_SELL
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoExItem

type InfoExItem struct {
	Date               uint32  `json:"date"`
	Bonus              float64 `json:"bonus"`
	DeliveredShares    float64 `json:"delivered_shares"`
	RationedSharePrice float64 `json:"rationed_share_price"`
	RationedShares     float64 `json:"rationed_shares"`
}

type ProtoRecord

type ProtoRecord struct {
	Date   int64   `protobuf:"zigzag64,1,opt,name=date" json:"date,omitempty"`
	Open   float64 `protobuf:"fixed64,2,opt,name=open" json:"open,omitempty"`
	Close  float64 `protobuf:"fixed64,3,opt,name=close" json:"close,omitempty"`
	High   float64 `protobuf:"fixed64,4,opt,name=high" json:"high,omitempty"`
	Low    float64 `protobuf:"fixed64,5,opt,name=low" json:"low,omitempty"`
	Volume float64 `protobuf:"fixed64,6,opt,name=volume" json:"volume,omitempty"`
	Amount float64 `protobuf:"fixed64,7,opt,name=amount" json:"amount,omitempty"`
}

func (*ProtoRecord) Descriptor

func (*ProtoRecord) Descriptor() ([]byte, []int)

func (*ProtoRecord) GetAmount

func (m *ProtoRecord) GetAmount() float64

func (*ProtoRecord) GetClose

func (m *ProtoRecord) GetClose() float64

func (*ProtoRecord) GetDate

func (m *ProtoRecord) GetDate() int64

func (*ProtoRecord) GetHigh

func (m *ProtoRecord) GetHigh() float64

func (*ProtoRecord) GetLow

func (m *ProtoRecord) GetLow() float64

func (*ProtoRecord) GetOpen

func (m *ProtoRecord) GetOpen() float64

func (*ProtoRecord) GetVolume

func (m *ProtoRecord) GetVolume() float64

func (*ProtoRecord) ProtoMessage

func (*ProtoRecord) ProtoMessage()

func (*ProtoRecord) Reset

func (m *ProtoRecord) Reset()

func (*ProtoRecord) String

func (m *ProtoRecord) String() string

type ProtoTick

type ProtoTick struct {
	Code        string    `protobuf:"bytes,1,opt,name=code" json:"code,omitempty"`
	Timestamp   int64     `protobuf:"zigzag64,2,opt,name=timestamp" json:"timestamp,omitempty"`
	HighLimited float64   `protobuf:"fixed64,3,opt,name=highLimited" json:"highLimited,omitempty"`
	LowLimited  float64   `protobuf:"fixed64,4,opt,name=lowLimited" json:"lowLimited,omitempty"`
	Price       float64   `protobuf:"fixed64,5,opt,name=price" json:"price,omitempty"`
	Position    float64   `protobuf:"fixed64,6,opt,name=position" json:"position,omitempty"`
	Settle      float64   `protobuf:"fixed64,7,opt,name=settle" json:"settle,omitempty"`
	Open        float64   `protobuf:"fixed64,8,opt,name=open" json:"open,omitempty"`
	Close       float64   `protobuf:"fixed64,9,opt,name=close" json:"close,omitempty"`
	High        float64   `protobuf:"fixed64,10,opt,name=high" json:"high,omitempty"`
	Low         float64   `protobuf:"fixed64,11,opt,name=low" json:"low,omitempty"`
	Volume      float64   `protobuf:"fixed64,12,opt,name=volume" json:"volume,omitempty"`
	TotalVolume float64   `protobuf:"fixed64,13,opt,name=totalVolume" json:"totalVolume,omitempty"`
	Amount      float64   `protobuf:"fixed64,14,opt,name=amount" json:"amount,omitempty"`
	TotalAmount float64   `protobuf:"fixed64,15,opt,name=totalAmount" json:"totalAmount,omitempty"`
	PreSettle   float64   `protobuf:"fixed64,16,opt,name=preSettle" json:"preSettle,omitempty"`
	PrePosition float64   `protobuf:"fixed64,17,opt,name=prePosition" json:"prePosition,omitempty"`
	PreClose    float64   `protobuf:"fixed64,18,opt,name=preClose" json:"preClose,omitempty"`
	AskPrices   []float64 `protobuf:"fixed64,19,rep,packed,name=askPrices" json:"askPrices,omitempty"`
	AskVolumes  []float64 `protobuf:"fixed64,20,rep,packed,name=askVolumes" json:"askVolumes,omitempty"`
	BidPrices   []float64 `protobuf:"fixed64,21,rep,packed,name=bidPrices" json:"bidPrices,omitempty"`
	BidVolumes  []float64 `protobuf:"fixed64,22,rep,packed,name=bidVolumes" json:"bidVolumes,omitempty"`
	Side        int32     `protobuf:"zigzag32,23,opt,name=side" json:"side,omitempty"`
	BuyVolume   float64   `protobuf:"fixed64,24,opt,name=buyVolume" json:"buyVolume,omitempty"`
	SellVolume  float64   `protobuf:"fixed64,25,opt,name=sellVolume" json:"sellVolume,omitempty"`
}

func (*ProtoTick) Descriptor

func (*ProtoTick) Descriptor() ([]byte, []int)

func (*ProtoTick) GetAmount

func (m *ProtoTick) GetAmount() float64

func (*ProtoTick) GetAskPrices

func (m *ProtoTick) GetAskPrices() []float64

func (*ProtoTick) GetAskVolumes

func (m *ProtoTick) GetAskVolumes() []float64

func (*ProtoTick) GetBidPrices

func (m *ProtoTick) GetBidPrices() []float64

func (*ProtoTick) GetBidVolumes

func (m *ProtoTick) GetBidVolumes() []float64

func (*ProtoTick) GetBuyVolume

func (m *ProtoTick) GetBuyVolume() float64

func (*ProtoTick) GetClose

func (m *ProtoTick) GetClose() float64

func (*ProtoTick) GetCode

func (m *ProtoTick) GetCode() string

func (*ProtoTick) GetHigh

func (m *ProtoTick) GetHigh() float64

func (*ProtoTick) GetHighLimited

func (m *ProtoTick) GetHighLimited() float64

func (*ProtoTick) GetLow

func (m *ProtoTick) GetLow() float64

func (*ProtoTick) GetLowLimited

func (m *ProtoTick) GetLowLimited() float64

func (*ProtoTick) GetOpen

func (m *ProtoTick) GetOpen() float64

func (*ProtoTick) GetPosition

func (m *ProtoTick) GetPosition() float64

func (*ProtoTick) GetPreClose

func (m *ProtoTick) GetPreClose() float64

func (*ProtoTick) GetPrePosition

func (m *ProtoTick) GetPrePosition() float64

func (*ProtoTick) GetPreSettle

func (m *ProtoTick) GetPreSettle() float64

func (*ProtoTick) GetPrice

func (m *ProtoTick) GetPrice() float64

func (*ProtoTick) GetSellVolume

func (m *ProtoTick) GetSellVolume() float64

func (*ProtoTick) GetSettle

func (m *ProtoTick) GetSettle() float64

func (*ProtoTick) GetSide

func (m *ProtoTick) GetSide() int32

func (*ProtoTick) GetTimestamp

func (m *ProtoTick) GetTimestamp() int64

func (*ProtoTick) GetTotalAmount

func (m *ProtoTick) GetTotalAmount() float64

func (*ProtoTick) GetTotalVolume

func (m *ProtoTick) GetTotalVolume() float64

func (*ProtoTick) GetVolume

func (m *ProtoTick) GetVolume() float64

func (*ProtoTick) ProtoMessage

func (*ProtoTick) ProtoMessage()

func (*ProtoTick) Reset

func (m *ProtoTick) Reset()

func (*ProtoTick) String

func (m *ProtoTick) String() string

type Record

type Record struct {
	Date       uint64  `bson:"_id"` // UTC毫秒数
	Open       float64 // 开盘价,精确到分
	Close      float64
	High       float64
	Low        float64
	Volume     float64
	Amount     float64
	BuyVolume  float64
	SellVolume float64
}

After price adjusted, it maybe a negative value

func RecordFromProtoBytes

func RecordFromProtoBytes(bytes []byte) (*Record, error)

func (*Record) Eq

func (this *Record) Eq(that *Record) bool

func (*Record) GetAmount

func (this *Record) GetAmount() float64

func (*Record) GetBuyVolume

func (this *Record) GetBuyVolume() float64

func (*Record) GetClose

func (this *Record) GetClose() float64

func (*Record) GetDate

func (this *Record) GetDate() string

func (*Record) GetHigh

func (this *Record) GetHigh() float64

func (*Record) GetLow

func (this *Record) GetLow() float64

func (*Record) GetOpen

func (this *Record) GetOpen() float64

func (*Record) GetSellVolume

func (this *Record) GetSellVolume() float64

func (*Record) GetUTCDate

func (this *Record) GetUTCDate() uint64

func (*Record) GetVolume

func (this *Record) GetVolume() float64

func (*Record) SetDate

func (this *Record) SetDate(s string)

func (*Record) String

func (this *Record) String() string

func (*Record) ToJsonBytes

func (this *Record) ToJsonBytes() ([]byte, error)

func (*Record) ToProtoBytes

func (this *Record) ToProtoBytes() ([]byte, error)

type RecordEx

type RecordEx struct {
	Record
	Code string
}

func (*RecordEx) ToJsonBytes

func (this *RecordEx) ToJsonBytes() ([]byte, error)

type Security

type Security struct {
	Category string
	Code     string
	Exchange string
	// contains filtered or unexported fields
}

func ParseSecurity

func ParseSecurity(securityCode string) (*Security, error)

func ParseSecurityUnsafe

func ParseSecurityUnsafe(securityCode string) *Security

func (*Security) CatCode

func (this *Security) CatCode() string

func (*Security) GetCategory

func (this *Security) GetCategory() string

func (*Security) GetCode

func (this *Security) GetCode() string

func (*Security) GetExchange

func (this *Security) GetExchange() string

func (*Security) IsDigitCurrency

func (this *Security) IsDigitCurrency() bool

func (*Security) IsIndex

func (this *Security) IsIndex() bool

func (*Security) IsSpot

func (this *Security) IsSpot() bool

func (*Security) String

func (this *Security) String() string

type TickItem

type TickItem struct {
	Code        string
	Timestamp   uint64
	HighLimited float64
	LowLimited  float64
	Price       float64
	Position    float64
	Settle      float64
	Open        float64
	Close       float64
	High        float64
	Low         float64
	Volume      float64
	TotalVolume float64
	Amount      float64
	TotalAmount float64
	PreSettle   float64
	PrePosition float64
	PreClose    float64
	AskPrices   []float64
	AskVolumes  []float64
	BidPrices   []float64
	BidVolumes  []float64
	Side        int
	BuyVolume   float64
	SellVolume  float64
}

func TickItemFromProtoBytes

func TickItemFromProtoBytes(bytes []byte) (*TickItem, error)

func (*TickItem) GetDate

func (this *TickItem) GetDate() string

func (*TickItem) ToJsonBytes

func (this *TickItem) ToJsonBytes() ([]byte, error)

func (*TickItem) ToProtoBytes

func (this *TickItem) ToProtoBytes() ([]byte, error)

Jump to

Keyboard shortcuts

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