From 49c6deb9c47713c3f6fc0d51457b14f2baedc50d Mon Sep 17 00:00:00 2001 From: injoyai <1113655791@qq.com> Date: Wed, 9 Apr 2025 17:02:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=97=B6=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=82=A1=E7=A5=A8=E5=80=BC=E4=B8=8D=E5=AF=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/CheckGetHistoryErr/main.go | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 example/CheckGetHistoryErr/main.go diff --git a/example/CheckGetHistoryErr/main.go b/example/CheckGetHistoryErr/main.go new file mode 100644 index 0000000..b2ebed9 --- /dev/null +++ b/example/CheckGetHistoryErr/main.go @@ -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 + + }) + } + +}