mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
吧代码的传参方式从sz,000001改成sz000001
This commit is contained in:
@@ -4,17 +4,11 @@ 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.GetHistoryMinuteTrade(protocol.HistoryMinuteTradeReq{
|
||||
Date: "20241027",
|
||||
Exchange: protocol.ExchangeSZ,
|
||||
Code: "000001",
|
||||
Count: 10,
|
||||
})
|
||||
resp, err := c.GetHistoryMinuteTrade("20241025", "sz000001", 0, 20)
|
||||
logs.PanicErr(err)
|
||||
|
||||
for _, v := range resp.List {
|
||||
|
||||
@@ -4,16 +4,11 @@ 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.GetHistoryMinuteTradeAll(protocol.HistoryMinuteTradeAllReq{
|
||||
Date: "20241027",
|
||||
Exchange: protocol.ExchangeSZ,
|
||||
Code: "000001",
|
||||
})
|
||||
resp, err := c.GetHistoryMinuteTradeAll("20241025", "sz000001")
|
||||
logs.PanicErr(err)
|
||||
|
||||
for _, v := range resp.List {
|
||||
|
||||
@@ -3,14 +3,13 @@ package main
|
||||
import (
|
||||
"github.com/injoyai/logs"
|
||||
"github.com/injoyai/tdx"
|
||||
"github.com/injoyai/tdx/protocol"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c, err := tdx.Dial("124.71.187.122:7709")
|
||||
c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug())
|
||||
logs.PanicErr(err)
|
||||
|
||||
resp, err := c.GetMinute(protocol.ExchangeSH, "000001")
|
||||
resp, err := c.GetMinute("sz000001")
|
||||
logs.PanicErr(err)
|
||||
|
||||
for _, v := range resp.List {
|
||||
|
||||
@@ -4,18 +4,12 @@ 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.GetMinuteTrade(protocol.MinuteTradeReq{
|
||||
Exchange: protocol.ExchangeSZ,
|
||||
Code: "000001",
|
||||
Start: 0,
|
||||
Count: 100,
|
||||
})
|
||||
resp, err := c.GetMinuteTrade("sz000001", 0, 100)
|
||||
logs.PanicErr(err)
|
||||
|
||||
for _, v := range resp.List {
|
||||
|
||||
@@ -3,12 +3,11 @@ package main
|
||||
import (
|
||||
"github.com/injoyai/logs"
|
||||
"github.com/injoyai/tdx"
|
||||
"github.com/injoyai/tdx/protocol"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
c, err := tdx.Dial("124.71.187.122:7709")
|
||||
c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug())
|
||||
logs.PanicErr(err)
|
||||
|
||||
_ = c
|
||||
@@ -16,19 +15,17 @@ func main() {
|
||||
/*
|
||||
发送:
|
||||
0c02000000011a001a003e05050000000000000002000030303030303101363030303038
|
||||
0c01000000011a001a003e05050000000000000002000030303030303101363030303038
|
||||
|
||||
接收:
|
||||
b1cb74001c00000000000d005100bd00789c6378c1cecb252ace6066c5b4898987b9050ed1f90cc5b74c18a5bc18c1b43490fecff09c81819191f13fc3c9f3bb169f5e7dfefeb5ef57f7199a305009308208e5b32bb6bcbf70148712002d7f1e13
|
||||
b1cb74000c02000000003e05ac00ac000102020000303030303031601294121a1c2d4eadabcf0ed412aae5fc01afb0024561124fbcc08301afa47900b2e3174100bf68871a4201b741b6144302bb09af334403972e96354504ac09b619560e00000000f8ff601201363030303038b60fba04060607429788a70efa04ada37ab2531c12974d91e7449dbc354184b6010001844bad324102b5679ea1014203a65abd8d0143048a6ba4dd01440587e101b3d2029613000000000000b60f
|
||||
*/
|
||||
resp, err := c.GetQuote(map[protocol.Exchange]string{
|
||||
protocol.ExchangeSZ: "000001",
|
||||
protocol.ExchangeSH: "600008",
|
||||
})
|
||||
resp, err := c.GetQuote("sz000001", "sh600008")
|
||||
logs.PanicErr(err)
|
||||
|
||||
for _, v := range resp {
|
||||
logs.Debugf("%#v\n", v)
|
||||
logs.Debug(v)
|
||||
}
|
||||
|
||||
select {}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func Test(f func(c *tdx.Client)) {
|
||||
c, err := tdx.Dial("124.71.187.122:7709")
|
||||
c, err := tdx.Dial("124.71.187.122:7709", tdx.WithDebug())
|
||||
logs.PanicErr(err)
|
||||
f(c)
|
||||
<-c.Done()
|
||||
|
||||
Reference in New Issue
Block a user