tracker

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreSnapshotTimeBegin = "09:25:00" // 缓存快照数据的开始时间
	StoreSnapshotTimeEnd   = "09:29:59" // 缓存快照数据的结束时间
	SectorMinChangeRate    = 0.10       // 板块开盘最小涨幅
	SectorMinVolume        = 1e8        // 板块开盘最低成交金额
)

策略常量

View Source
const (
	SecurityUnknown = "unknown"
)

Variables

This section is empty.

Functions

func AllScan added in v1.1.6

func AllScan(barIndex *int, model models.Strategy)

AllScan 全市场扫描

func BackTesting

func BackTesting(countDays, countTopN int)

BackTesting 回测

func BlockTypeName added in v1.1.6

func BlockTypeName(blockCode string) string

func CheckStrategy added in v1.0.2

func CheckStrategy(strategyCode uint64, securityCode string)

CheckStrategy 检查当前交易日中个股在策略中的执行情况

func ExecuteStrategy added in v1.2.2

func ExecuteStrategy(model models.Strategy, barIndex *int)

ExecuteStrategy 执行策略

func GetBlockList added in v1.1.6

func GetBlockList() []string

func MarketSentiment added in v1.1.6

func MarketSentiment()

MarketSentiment 市场情绪

func OutputTable added in v1.1.6

func OutputTable(model models.Strategy, stockSnapshots []factors.QuoteSnapshot)

OutputTable 输出表格

func ScanAllSectors added in v1.2.5

func ScanAllSectors(barIndex *int, model models.Strategy)

ScanAllSectors 扫描板块

func ScanSectorForTick added in v1.1.6

func ScanSectorForTick(barIndex *int) []string

ScanSectorForTick 扫描板块

func SectorSort added in v1.1.6

func SectorSort(a, b factors.QuoteSnapshot) bool

SectorSort 板块排序

func StockSort added in v1.1.6

func StockSort(a, b factors.QuoteSnapshot) bool

StockSort 个股排序

func TopBlockWithType added in v1.1.6

func TopBlockWithType(pbarIndex *int) map[securities.BlockType][]SectorInfo

TopBlockWithType 板块排行

func Tracker added in v1.1.6

func Tracker(strategyNumbers ...uint64)

Tracker 盘中跟踪

Types

type GoodCase

type GoodCase struct {
	Date   string  `dataframe:"日期"`
	Num    int     `dataframe:"数量"`
	Yields float64 `dataframe:"浮动收益率%"`
	//NextYields float64 `dataframe:"隔日收益率%"`
	GtP1 float64 `dataframe:"胜率率%"`
	GtP2 float64 `dataframe:"溢价超1%"`
	GtP3 float64 `dataframe:"溢价超2%"`
	GtP4 float64 `dataframe:"溢价超3%"`
	GtP5 float64 `dataframe:"溢价超5%"`
}

type SampleFeature

type SampleFeature struct {
	SecurityCode      string
	Name              string
	OpenChangeRate    float64
	OpenTurnZ         float64
	LastClose         float64
	Open              float64
	Price             float64
	UpRate            float64
	OpenPremiumRate   float64
	NextPremiumRate   float64
	OpenQuantityRatio float64 // 量比
}

SampleFeature 样本特征

type SectorInfo added in v1.1.6

type SectorInfo struct {
	Code           string   `name:"代码"`     // 板块代码
	Name           string   `name:"名称"`     // 板块名称
	Type           string   `name:"类型"`     // 板块类型
	OpenAmount     float64  `name:"开盘金额"`   // 开盘金额
	OpenChangeRate float64  `name:"开盘涨幅"`   // 开盘涨幅
	ChangeRate     float64  `name:"板块涨幅"`   // 板块涨幅
	Rank           int      `name:"板块排名"`   // 板块排名
	TopCode        string   `name:"领涨个股"`   // 领涨个股
	TopName        string   `name:"领涨个股名称"` // 领涨个股名称
	TopRate        float64  `name:"领涨个股涨幅"` // 领涨个股涨幅
	Count          int      `name:"总数"`     // 总数
	LimitUpNum     int      `name:"涨停数"`    // 涨停数
	NoChangeNum    int      `name:"平盘数"`    // 平盘数
	UpCount        int      `name:"上涨家数"`   // 上涨家数
	DownCount      int      `name:"下跌家数"`   // 下跌家数
	Capital        float64  // 流通盘
	FreeCapital    float64  // 自由流通股本
	OpenTurnZ      float64  `name:"开盘换手"`   // 开盘换手
	StockCodes     []string `dataframe:"-"` // 股票代码
}

SectorInfo 板块信息

Jump to

Keyboard shortcuts

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