mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
修复指数判断不全的问题
This commit is contained in:
@@ -2,6 +2,8 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/injoyai/logs"
|
"github.com/injoyai/logs"
|
||||||
"github.com/injoyai/tdx"
|
"github.com/injoyai/tdx"
|
||||||
)
|
)
|
||||||
@@ -13,4 +15,11 @@ func main() {
|
|||||||
c := cs.Get("sz000001")
|
c := cs.Get("sz000001")
|
||||||
|
|
||||||
fmt.Println(c.FloatStock, c.TotalStock)
|
fmt.Println(c.FloatStock, c.TotalStock)
|
||||||
|
|
||||||
|
for _, v := range cs.GetIndexes().Codes() {
|
||||||
|
if strings.HasPrefix(v, "sz") {
|
||||||
|
logs.Debug(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,7 +302,9 @@ func IsIndex(code string) bool {
|
|||||||
case code[0:2] == ExchangeSH.String() && code[2:5] == "000":
|
case code[0:2] == ExchangeSH.String() && code[2:5] == "000":
|
||||||
return true
|
return true
|
||||||
case code[0:2] == ExchangeSZ.String() && code[2:5] == "399":
|
case code[0:2] == ExchangeSZ.String() && code[2:5] == "399":
|
||||||
|
return true
|
||||||
case code[0:2] == ExchangeBJ.String() && code[2:5] == "899":
|
case code[0:2] == ExchangeBJ.String() && code[2:5] == "899":
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user