gitee.com/quant1x/engine@v1.8.4/models/strategy_result.go (about)

     1  package models
     2  
     3  // ResultInfo 策略结果
     4  type ResultInfo struct {
     5  	Code           string  `name:"证券代码" dataframe:"code"`
     6  	Name           string  `name:"证券名称" dataframe:"name"`
     7  	Date           string  `name:"信号日期" dataframe:"date"`
     8  	TurnZ          float64 `name:"开盘换手Z" dataframe:"turn_z"`
     9  	Rate           float64 `name:"涨跌幅%" dataframe:"rate"`
    10  	Buy            float64 `name:"委托价格" dataframe:"buy"`
    11  	Sell           float64 `name:"目标价格" dataframe:"sell"`
    12  	StrategyCode   uint64  `name:"策略编码" dataframe:"strategy_code"`
    13  	StrategyName   string  `name:"策略名称" dataframe:"strategy_name"`
    14  	BlockType      string  `name:"板块类型" dataframe:"block_type"`
    15  	BlockCode      string  `name:"板块代码" dataframe:"block_code"`
    16  	BlockName      string  `name:"板块名称" dataframe:"block_name"`
    17  	BlockRate      float64 `name:"板块涨幅%" dataframe:"block_rate"`
    18  	BlockTop       int     `name:"板块排名" dataframe:"block_top"`
    19  	BlockRank      int     `name:"个股排名" dataframe:"block_rank"`
    20  	BlockZhangTing string  `name:"板块涨停数" dataframe:"block_zhangting"`
    21  	BlockDescribe  string  `name:"涨/跌/平" dataframe:"block_describe"`
    22  	BlockTopCode   string  `name:"领涨股代码" dataframe:"block_top_code"`
    23  	BlockTopName   string  `name:"领涨股名称" dataframe:"block_top_name"`
    24  	BlockTopRate   float64 `name:"领涨股涨幅%" dataframe:"block_top_rate"`
    25  	Tendency       string  `name:"短线趋势" dataframe:"tendency"`
    26  }
    27  
    28  // Predict 预测趋势
    29  func (this *ResultInfo) Predict() {
    30  	//N := 3
    31  	//df := factors.BasicKLine(this.Code)
    32  	//if df.Nrow() < N+1 {
    33  	//	return
    34  	//}
    35  	//limit := api.RangeFinite(-N)
    36  	//OPEN := df.Col("open").Select(limit)
    37  	//CLOSE := df.Col("close").Select(limit)
    38  	//HIGH := df.Col("high").Select(limit)
    39  	//LOW := df.Col("low").Select(limit)
    40  	//lastClose := num.AnyToFloat64(CLOSE.IndexOf(-1))
    41  	//po := linear.CurveRegression(OPEN).IndexOf(-1).(num.DType)
    42  	//pc := linear.CurveRegression(CLOSE).IndexOf(-1).(num.DType)
    43  	//ph := linear.CurveRegression(HIGH).IndexOf(-1).(num.DType)
    44  	//pl := linear.CurveRegression(LOW).IndexOf(-1).(num.DType)
    45  	//if po > lastClose {
    46  	//	this.Tendency = "高开"
    47  	//} else if po == lastClose {
    48  	//	this.Tendency = "平开"
    49  	//} else {
    50  	//	this.Tendency = "低开"
    51  	//}
    52  	//if pl > ph {
    53  	//	this.Tendency += ",冲高回落"
    54  	//} else if pl > pc {
    55  	//	this.Tendency += ",探底回升"
    56  	//} else if pc < pl {
    57  	//	this.Tendency += ",趋势向下"
    58  	//} else {
    59  	//	this.Tendency += ",短线向好"
    60  	//}
    61  	//
    62  	//fs := []float64{float64(po), float64(pc), float64(ph), float64(pl)}
    63  	//sort.Float64s(fs)
    64  	//
    65  	//_ = lastClose
    66  }