gitee.com/quant1x/engine@v1.8.4/market/market_test.go (about)

     1  package market
     2  
     3  import (
     4  	"fmt"
     5  	"gitee.com/quant1x/exchange"
     6  	"strings"
     7  	"testing"
     8  )
     9  
    10  func TestGetCodeList(t *testing.T) {
    11  	codes := GetCodeList()
    12  	fmt.Println(len(codes))
    13  	codes = GetStockCodeList()
    14  	fmt.Println(len(codes))
    15  }
    16  
    17  func TestPriceLimit(t *testing.T) {
    18  	code := "sh603598"
    19  	lastClose := 19.00
    20  	up, down := PriceLimit(code, lastClose)
    21  	fmt.Println(up, down)
    22  }
    23  
    24  func TestGetQmtCodeList(t *testing.T) {
    25  	batchMax := 1000
    26  	codes := GetStockCodeList()
    27  	codes = codes[0:batchMax]
    28  	var list []string
    29  	for _, v := range codes {
    30  		_, mflag, symbol := exchange.DetectMarket(v)
    31  		securityCode := fmt.Sprintf("%s.%s", symbol, strings.ToUpper(mflag))
    32  		list = append(list, securityCode)
    33  	}
    34  	fmt.Println(strings.Join(list, ","))
    35  	_ = batchMax
    36  }