models

package
v1.5.28 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaximumResultDays 结果最大天数
	MaximumResultDays int = 3
	// CACHE_STRATEGY_PATH 策略文件存储路径
	CACHE_STRATEGY_PATH = "strategy"
)
View Source
const (
	BlockTopN    = 3  // 板块排行前几名
	StockTopN    = 3  // 板块个股前几名
	AllStockTopN = 10 // 全部代码前几名
)

板块常量

Variables

This section is empty.

Functions

func BlockSort

func BlockSort(a, b trade.QuoteSnapshot) bool

板块排序

func BlockTypeName

func BlockTypeName(blockCode string) string

func GetBlockList

func GetBlockList() []string

func SliceToPoints

func SliceToPoints(x []float64) plotter.XYs

func StockSort

func StockSort(a, b trade.QuoteSnapshot) bool

个股排序

Types

type BlockInfo

type BlockInfo struct {
	BlockCode  string   // 板块代码
	BlockName  string   // 板块名称
	BlockType  string   // 板块类型
	ZhangDieFu float64  // 板块涨幅
	BlockTop   int      // 板块排名
	TopCode    string   // 领涨个股
	TopName    string   // 领涨个股名称
	TopRate    float64  // 领涨个股涨幅
	ZhanTing   int      // 涨停数
	Ling       int      // 平盘数
	Count      int      // 总数
	Up         int      // 上涨家数
	Down       int      // 下定家数
	LiuTongPan float64  // 流通盘
	FreeGuBen  float64  // 自由流通股本
	TurnZ      float64  // 开盘换手
	StockCodes []string `dataframe:"-"` // 股票代码

}

BlockInfo 板块信息

func TopBlock

func TopBlock(pbarIndex *int) []BlockInfo

TopBlock 板块排行

type FormulaNo0

type FormulaNo0 struct{}

FormulaNo0 0号策略

func (*FormulaNo0) Code

func (this *FormulaNo0) Code() int

func (*FormulaNo0) Evaluate

func (this *FormulaNo0) Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)

func (*FormulaNo0) Name

func (this *FormulaNo0) Name() string

type FormulaNo1

type FormulaNo1 struct {
}

FormulaNo1 3天内5天线上穿10天线,10天线上穿20天线的个股

count(cross(MA(c,5),MA(c,10)),3)>=1 and count(cross(MA(c,10),MA(c,20)),3)>=1

func (*FormulaNo1) Code

func (this *FormulaNo1) Code() int

func (*FormulaNo1) Evaluate

func (this *FormulaNo1) Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)

Evaluate 评估K线数据

func (*FormulaNo1) Name

func (this *FormulaNo1) Name() string

type FormulaNo3

type FormulaNo3 struct{}

func (FormulaNo3) Code

func (this FormulaNo3) Code() int

func (FormulaNo3) Evaluate

func (this FormulaNo3) Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)

func (FormulaNo3) Name

func (this FormulaNo3) Name() string

type FormulaNo84

type FormulaNo84 struct{}

func (FormulaNo84) Code

func (this FormulaNo84) Code() int

func (FormulaNo84) Evaluate

func (this FormulaNo84) Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)

func (FormulaNo84) Name

func (this FormulaNo84) Name() string

type FormulaNo85

type FormulaNo85 struct{}

func (FormulaNo85) Code

func (this FormulaNo85) Code() int

func (FormulaNo85) Evaluate

func (this FormulaNo85) Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)

func (FormulaNo85) Name

func (this FormulaNo85) Name() string

type FormulaNo89

type FormulaNo89 struct{}

func (FormulaNo89) Code

func (this FormulaNo89) Code() int

func (FormulaNo89) Evaluate

func (this FormulaNo89) Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)

func (FormulaNo89) Name

func (this FormulaNo89) Name() string

type ResultInfo

type ResultInfo struct {
	Code         string  `name:"证券代码" json:"code" csv:"code" array:"0"`
	Name         string  `name:"证券名称" json:"name" csv:"name" array:"1"`
	Date         string  `name:"信号日期" json:"date" csv:"date" array:"2"`
	TurnZ        float64 `name:"开盘换手Z" json:"turn_z" csv:"turn_z" arrar:"3"`
	Rate         float64 `name:"涨跌幅%" json:"rate" csv:""`
	Buy          float64 `name:"委托价格" json:"buy" csv:"buy" array:"3"`
	Sell         float64 `name:"目标价格" json:"sell" csv:"sell" array:"4"`
	StrategyCode int     `name:"策略编码" json:"strategy_code" csv:"strategy_code" array:"5"`
	StrategyName string  `name:"策略名称" json:"strategy_name" csv:"strategy_name" array:"6"`
	//BlockCode    string  `name:"板块代码" json:"block_code" csv:"block_code" array:"7"`
	BlockType      string  `name:"板块类型"`
	BlockName      string  `name:"板块名称" json:"block_name" csv:"block_name" array:"7"`
	BlockRate      float64 `name:"板块涨幅%" json:"block_rate" csv:"block_rate" array:"8"`
	BlockTop       int     `name:"板块排名" json:"block_top" csv:"block_top" array:"9"`
	BlockRank      int     `name:"个股排名" json:"block_rank" csv:"block_top" array:"10"`
	BlockZhangTing string  `name:"板块涨停数" json:"block_zhangting" csv:"block_zhangting" array:"11"`
	BlockDescribe  string  `name:"上涨/下跌/平盘" json:"block_describe" csv:"block_describe" array:"12"`
	//BlockTopCode string  `name:"领涨股代码" json:"block_top_code" csv:"block_top_code" array:"12"`
	BlockTopName string  `name:"领涨股名称" json:"block_top_name" csv:"block_top_name" array:"13"`
	BlockTopRate float64 `name:"领涨股涨幅%" json:"block_top_rate" csv:"block_top_rate" array:"14"`
	Tendency     string  `name:"短线趋势" json:"tendency" csv:"tendency" array:"15"`
}

ResultInfo 策略结果

func (*ResultInfo) Cross

func (this *ResultInfo) Cross() bool

Cross 预测趋势

func (*ResultInfo) DetectVolume

func (this *ResultInfo) DetectVolume() bool

DetectVolume 检测量能变化

func (*ResultInfo) Headers

func (this *ResultInfo) Headers() []string

func (*ResultInfo) Predict

func (this *ResultInfo) Predict()

Predict 预测趋势

func (*ResultInfo) Sample

func (this *ResultInfo) Sample() bool

Sample 处理结果的置信区间

func (*ResultInfo) V1DetectVolume

func (this *ResultInfo) V1DetectVolume() bool

DetectVolume 检测量能变化

func (*ResultInfo) Values

func (this *ResultInfo) Values() []string

Values 输出表格的行和列

type Strategy

type Strategy interface {
	// Name 策略名称
	Name() string
	// Code 策略编号
	Code() int
	// Evaluate 评估 日线数据
	Evaluate(fullCode string, info *security.StaticBasic, result *treemap.Map)
}

Strategy 策略/公式指标(features)接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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