mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
测试分时部分股票值不对的问题
This commit is contained in:
34
example/CheckGetHistoryErr/main.go
Normal file
34
example/CheckGetHistoryErr/main.go
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/injoyai/logs"
|
||||||
|
"github.com/injoyai/tdx"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
m, err := tdx.NewManage(nil)
|
||||||
|
logs.PanicErr(err)
|
||||||
|
|
||||||
|
codes := m.Codes.GetStocks()
|
||||||
|
codes = []string{
|
||||||
|
"sz000001",
|
||||||
|
"sz000002",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, code := range codes {
|
||||||
|
m.Do(func(c *tdx.Client) error {
|
||||||
|
resp, err := c.GetHistoryMinute(time.Now().Format("20060102"), code)
|
||||||
|
logs.PanicErr(err)
|
||||||
|
|
||||||
|
resp2, err := c.GetKlineDay(code, 0, 1)
|
||||||
|
logs.PanicErr(err)
|
||||||
|
|
||||||
|
logs.Debug(code, resp2.List[0].Close == resp.List[len(resp.List)-1].Price)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user