gitee.com/quant1x/engine@v1.8.4/tracker/sector_filter.go (about)

     1  package tracker
     2  
     3  import (
     4  	"slices"
     5  )
     6  
     7  // 策略常量
     8  const (
     9  	StoreSnapshotTimeBegin = "09:25:00" // 缓存快照数据的开始时间
    10  	StoreSnapshotTimeEnd   = "09:29:59" // 缓存快照数据的结束时间
    11  	SectorMinChangeRate    = 0.10       // 板块开盘最小涨幅
    12  	SectorMinVolume        = 1e8        // 板块开盘最低成交金额
    13  )
    14  
    15  var (
    16  	blockIgnoreList = []string{"sh880516"} // ST板块
    17  )
    18  
    19  // 板块过滤规则, 早盘
    20  func sectorFilterForHead(info SectorInfo) bool {
    21  	if slices.Contains(blockIgnoreList, info.Code) {
    22  		return false
    23  	}
    24  	if info.OpenChangeRate <= SectorMinChangeRate {
    25  		return false
    26  	}
    27  	if info.OpenAmount <= SectorMinVolume {
    28  		return false
    29  	}
    30  	return true
    31  }
    32  
    33  // 板块过滤规则, 盘中
    34  func sectorFilterForTick(info SectorInfo) bool {
    35  	if slices.Contains(blockIgnoreList, info.Code) {
    36  		return false
    37  	}
    38  	if info.ChangeRate <= SectorMinChangeRate {
    39  		return false
    40  	}
    41  	return true
    42  }
    43  
    44  // 盘中过滤规则
    45  func tickSectorFilter(info SectorInfo) bool {
    46  	if slices.Contains(blockIgnoreList, info.Code) {
    47  		return false
    48  	}
    49  	if info.OpenChangeRate <= SectorMinChangeRate {
    50  		return false
    51  	}
    52  	if info.OpenAmount <= SectorMinVolume {
    53  		return false
    54  	}
    55  	if info.ChangeRate < 0.00 {
    56  		return false
    57  	}
    58  	return true
    59  }