model

package
v0.0.0-...-fc71e4b Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnakeCase

func CamelToSnakeCase(str string) string

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(uri string) (db *DB, err error)

func (*DB) AddMarketData

func (db *DB) AddMarketData(data *ctp.CThostFtdcDepthMarketDataField) (err error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) GetDatas

func (db *DB) GetDatas(symbol string, start, end time.Time) (datas []MarketData, err error)

type MarketData

type MarketData struct {
	Ts                 time.Time `db:"ts"`
	TradingDay         string    `db:"trading_day"`
	InstrumentID       string    `db:"instrument_id"`
	ExchangeID         string    `db:"exchange_id"`
	ExchangeInstID     string    `db:"exchange_inst_id"`
	ActionDay          string
	LastPrice          float64
	PreSettlementPrice float64
	PreClosePrice      float64
	PreOpenInterest    float64
	OpenPrice          float64
	HighestPrice       float64
	LowestPrice        float64
	Volume             int
	Turnover           float64
	OpenInterest       float64
	ClosePrice         float64
	SettlementPrice    float64
	UpperLimitPrice    float64
	LowerLimitPrice    float64
	PreDelta           float64
	CurrDelta          float64
	BidPrice1          float64
	BidVolume1         int
	AskPrice1          float64
	AskVolume1         int
	BidPrice2          float64
	BidVolume2         int
	AskPrice2          float64
	AskVolume2         int
	BidPrice3          float64
	BidVolume3         int
	AskPrice3          float64
	AskVolume3         int
	BidPrice4          float64
	BidVolume4         int
	AskPrice4          float64
	AskVolume4         int
	BidPrice5          float64
	BidVolume5         int
	AskPrice5          float64
	AskVolume5         int
	AveragePrice       float64
}

Jump to

Keyboard shortcuts

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