comm

package
v0.0.0-...-8640d22 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STOCKA = iota // 股票
	STOCKB        // B股个股
	FUNDS         // 基金
	INDEX         // 指数
	BOND          // 债券 ...
)

Variables

This section is empty.

Functions

func BufferToDouble

func BufferToDouble(buffer []byte) (int, float64)

*

  • 从tdx的封包中解密价格数据

func DoubleToBuf

func DoubleToBuf(inputValue float64, lpTargetBuffer interface{})

todo: 待处理

func GetFinanceDataFrame

func GetFinanceDataFrame(conf IConfigure, types ...int) dataframe.DataFrame

*

  • 获取股票、基金、指数等信息

Types

type CApp

type CApp struct {
	Mode     string `toml:"mode"`
	DataPath string `toml:"data_path"`
	Logger   struct {
		Level string `toml:"level"`
		Name  string `toml:"name"`
	} `toml:"logger"`
}

type CTdx

type CTdx struct {
	Urls struct {
		StockFin    string `toml:"stock_fin"`
		FinListFile string `toml:"fin_list_file"`
	} `toml:"urls"`
	Files struct {
		Calendar    string `toml:"calendar"`
		StockSt     string `toml:"stock_st"`
		StockList   string `toml:"stock_list"`
		StockBonus  string `toml:"stock_bonus"`
		StockDay    string `toml:"stock_day"`
		StockMin    string `toml:"stock_min"`
		StockReport string `toml:"stock_report"`
	} `toml:"files"`
	Server struct {
		DataHost    string `toml:"data_host"`
		MonitorHost string `toml:"monitor_host"`
	} `toml:"server"`
}

type CalendarModel

type CalendarModel struct {
	Date int
	Open bool

	WeekEnd    bool
	MonthEnd   bool
	QuarterEnd bool
	YearEnd    bool
	// contains filtered or unexported fields
}

func NewCalendarModel

func NewCalendarModel(date int, open bool, prevDate int, weekEnd, monthEnd, quarterEnd, yearEnd bool) CalendarModel

type Conf

type Conf struct {
	App CApp `toml:"app"`
	Tdx CTdx `toml:"tdx"`
}

func (*Conf) GetApp

func (c *Conf) GetApp() CApp

func (*Conf) GetTdx

func (c *Conf) GetTdx() CTdx

func (*Conf) Parse

func (c *Conf) Parse(path string)

Will try to parse TOML configuration file.

type IConfigure

type IConfigure interface {
	Parse(path string)

	GetApp() CApp
	GetTdx() CTdx
}

type StockCalendar

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

func DefaultStockCalendar

func DefaultStockCalendar(calendarPath string) (*StockCalendar, error)

func (*StockCalendar) Each

func (cal *StockCalendar) Each(f func(dateItem CalendarModel) error) error

func (*StockCalendar) NextDay

func (cal *StockCalendar) NextDay(day string) (string, error)

*

  • 获取指定日期的下一个交易日
  • day: yyyymmdd

func (*StockCalendar) PrevDay

func (cal *StockCalendar) PrevDay(day string) (string, error)

*

  • 获取指定日期的上一个交易日
  • day: yyyymmdd

Jump to

Keyboard shortcuts

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