base

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockPath = "/T0002/blocknew"
	ZxgBlk    = "zxg.blk"
	BkltBlk   = "BKLT.blk"
	ZdBk      = "ZDBK.blk"
)
View Source
const (
	TickDefaultStartDate = "2023-01-01" // 分笔成交最早的日期

)

Variables

View Source
var (
	FBarsRaw        = []string{"Open", "Close", "High", "Low", "Vol", "Amount", "DateTime", "UpCount", "DownCount"}
	FBarsRename     = []string{"open", "close", "high", "low", "volume", "amount", "date", "up", "down"}
	FBarsHelfFields = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "open_volume", "open_turnz", "open_unmatched", "close_volume", "close_turnz", "close_unmatched", "inner_volume", "outer_volume", "inner_amount", "outer_amount"}
	FBarsFields     = []string{"date", "open", "close", "high", "low", "volume", "amount", "up", "down", "last_close", "turnover_rate", "open_volume", "open_turnz", "open_unmatched", "close_volume", "close_turnz", "close_unmatched", "inner_volume", "outer_volume", "inner_amount", "outer_amount"}
)
View Source
var (
	// BasicFields 特征基础字段
	BasicFields = []string{"date", "open", "close", "high", "low", "volume", "amount"}
)
View Source
var (
	// DataDaysDiff 日期差异偏移量
	DataDaysDiff = 1
)
View Source
var (
	TdxFieldsFundFlow = []string{"日期", "主力净额金额(元)", "主力净额占比(%)", "超大单净买入金额(元)", "超大单净买入占比(%)", "大单净买入金额(元)", "大单净买入占比(%)", "主买净额金额(元)", "主买净额占比(%)"}
)

Functions

func BatchKLineWideRealtime

func BatchKLineWideRealtime(codes []string) error

BatchKLineWideRealtime 批量获取实时行情数据

func BatchRealtimeBasicKLine

func BatchRealtimeBasicKLine(codes []string) error

BatchRealtimeBasicKLine 批量获取实时行情数据

func CountInflow

func CountInflow(list []quotes.TickTransaction, securityCode string) (summary cache.TurnoverDataSummary)

CountInflow 统计内外盘

func FundFlow

func FundFlow(securityCode string) pandas.DataFrame

FundFlow 资金流向

deprecated: 不推荐

func GetCacheKLine

func GetCacheKLine(code string, adjust ...bool) pandas.DataFrame

GetCacheKLine 加载K线

第2个参数, 是否前复权

func GetCacheXdxrList

func GetCacheXdxrList(securityCode string) []quotes.XdxrInfo

GetCacheXdxrList 获取除权除息的数据列表

func GetKLineAll

func GetKLineAll(securityCode string, argv ...int) pandas.DataFrame

GetKLineAll 获取日K线

func GetTickAll

func GetTickAll(securityCode string)

GetTickAll 下载全部tick数据

func GetTickData

func GetTickData(securityCode string, date string) pandas.DataFrame

GetTickData 获取指定日期的分笔成交记录

func GetTickStartDate

func GetTickStartDate() string

func GetZxgList

func GetZxgList() []string

func InflowCount

func InflowCount(df pandas.DataFrame, securityCode string) (summary cache.TurnoverDataSummary)

InflowCount 统计内外盘

func SetKLineOffset

func SetKLineOffset(days int)

SetKLineOffset 设置K线数据调整回补天数

func Transaction

func Transaction(securityCode, tradeDate string) []quotes.TickTransaction

Transaction 获取指定日期的历史成交数据

func UpdateTickStartDate

func UpdateTickStartDate(date string)

UpdateTickStartDate 修改tick数据开始下载的日期

func UpdateXdxrInfo

func UpdateXdxrInfo(securityCode string)

UpdateXdxrInfo 除权除息数据

Types

type KLine

type KLine struct {
	Date   string  `dataframe:"date"`   // 日期
	Open   float64 `dataframe:"open"`   // 开盘价
	Close  float64 `dataframe:"close"`  // 收盘价
	High   float64 `dataframe:"high"`   // 最高价
	Low    float64 `dataframe:"low"`    // 最低价
	Volume float64 `dataframe:"volume"` // 成交量
	Amount float64 `dataframe:"amount"` // 成交金额
	Up     int     `dataframe:"up"`     // 上涨家数
	Down   int     `dataframe:"down"`   // 下跌家数
}

KLine 日K线基础结构

func LoadBasicKline

func LoadBasicKline(securityCode string) []KLine

LoadBasicKline 加载基础K线

func UpdateAllBasicKLine

func UpdateAllBasicKLine(securityCode string) []KLine

UpdateAllBasicKLine 更新全部日K线基础数据并保存文件

Jump to

Keyboard shortcuts

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