增加分时成交函数,数据已经校对,和通达信和东方财富能对应上

This commit is contained in:
钱纯净
2024-10-28 22:52:33 +08:00
parent 791bd4bfac
commit 6ec87de116
12 changed files with 191 additions and 62 deletions

View File

@@ -10,7 +10,7 @@ func main() {
c, err := tdx.Dial("124.71.187.122:7709")
logs.PanicErr(err)
resp, err := c.GetStockList(protocol.ExchangeSH, 200)
resp, err := c.GetStockList(protocol.ExchangeSH, 255)
logs.PanicErr(err)
for _, v := range resp.List {

View File

@@ -0,0 +1,23 @@
package main
import (
"github.com/injoyai/logs"
"github.com/injoyai/tdx"
"github.com/injoyai/tdx/example/common"
"github.com/injoyai/tdx/protocol"
)
func main() {
common.Test(func(c *tdx.Client) {
resp, err := c.GetStockMinuteTrade(protocol.ExchangeSH, "000001", 0, 100)
logs.PanicErr(err)
for _, v := range resp.List {
logs.Debug(v)
}
logs.Debug("总数:", resp.Count)
})
}

13
example/common/common.go Normal file
View File

@@ -0,0 +1,13 @@
package common
import (
"github.com/injoyai/logs"
"github.com/injoyai/tdx"
)
func Test(f func(c *tdx.Client)) {
c, err := tdx.Dial("124.71.187.122:7709")
logs.PanicErr(err)
f(c)
<-c.Done()
}