mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
优化protocol.Trades,能直接生成完整的分时k线,和实际误差很小
This commit is contained in:
22
example/TradesToKlines/main.go
Normal file
22
example/TradesToKlines/main.go
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/injoyai/logs"
|
||||||
|
"github.com/injoyai/tdx"
|
||||||
|
"github.com/injoyai/tdx/example/common"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
common.Test(func(c *tdx.Client) {
|
||||||
|
|
||||||
|
resp, err := c.GetHistoryTradeAll("20251010", "sz000001")
|
||||||
|
logs.PanicErr(err)
|
||||||
|
|
||||||
|
ks := resp.List.Klines()
|
||||||
|
|
||||||
|
for _, v := range ks {
|
||||||
|
logs.Debug(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user