gitee.com/quant1x/engine@v1.8.4/factors/feature_aggregation_test.go (about)

     1  package factors
     2  
     3  import (
     4  	"fmt"
     5  	"gitee.com/quant1x/gotdx/securities"
     6  	"testing"
     7  )
     8  
     9  func TestGetL5History(t *testing.T) {
    10  	code := "sz000713"
    11  	v := GetL5History(code)
    12  	fmt.Println(v)
    13  }
    14  
    15  func TestMisc(t *testing.T) {
    16  	code := "sh000001"
    17  	v := GetL5Misc(code)
    18  	fmt.Println(v)
    19  }
    20  
    21  func TestFilterL5Misc(t *testing.T) {
    22  	rows := FilterL5Misc(func(v *Misc) bool {
    23  		c1 := v.BullPower > v.BearPower
    24  		//c2 := v.BullPower > 0 && v.BearPower != 0
    25  		c2 := v.PowerTrendPeriod == 1
    26  		return c1 && c2
    27  	}, "20240205")
    28  	for _, v := range rows {
    29  		fmt.Println(v.Code, securities.GetStockName(v.Code))
    30  	}
    31  	fmt.Println("total:", len(rows))
    32  }