Merge remote-tracking branch 'origin/master'

# Conflicts:
#	README.md
This commit is contained in:
钱纯净
2024-11-04 23:31:02 +08:00
28 changed files with 526 additions and 419 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, 369)
resp, err := c.GetCode(protocol.ExchangeSH, 369)
logs.PanicErr(err)
for i, v := range resp.List {

View File

@@ -9,7 +9,7 @@ import (
func main() {
common.Test(func(c *tdx.Client) {
resp, err := c.GetStockAll(protocol.ExchangeSZ)
resp, err := c.GetCodeAll(protocol.ExchangeSZ)
logs.PanicErr(err)
for _, v := range resp.List {

View File

@@ -10,7 +10,7 @@ func main() {
c, err := tdx.Dial("124.71.187.122:7709")
logs.PanicErr(err)
resp, err := c.GetStockCount(protocol.ExchangeSH)
resp, err := c.GetCount(protocol.ExchangeSH)
logs.PanicErr(err)
logs.Debug(resp.Count)

View File

@@ -0,0 +1,26 @@
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.GetHistoryMinuteTrade(protocol.HistoryMinuteTradeReq{
Date: "20241027",
Exchange: protocol.ExchangeSZ,
Code: "000001",
Count: 10,
})
logs.PanicErr(err)
for _, v := range resp.List {
logs.Debug(v)
}
logs.Debug("总数:", resp.Count)
})
}

View File

@@ -5,13 +5,15 @@ import (
"github.com/injoyai/tdx"
"github.com/injoyai/tdx/example/common"
"github.com/injoyai/tdx/protocol"
"time"
)
func main() {
common.Test(func(c *tdx.Client) {
t := time.Date(2024, 10, 28, 0, 0, 0, 0, time.Local)
resp, err := c.GetStockHistoryMinuteTrade(t, protocol.ExchangeSH, "000001", 0, 2000)
resp, err := c.GetHistoryMinuteTradeAll(protocol.HistoryMinuteTradeAllReq{
Date: "20241027",
Exchange: protocol.ExchangeSZ,
Code: "000001",
})
logs.PanicErr(err)
for _, v := range resp.List {

View File

@@ -9,7 +9,7 @@ import (
func main() {
common.Test(func(c *tdx.Client) {
resp, err := c.GetStockKlineDayAll(protocol.ExchangeSH, "000001")
resp, err := c.GetKlineDayAll(protocol.ExchangeSH, "000001")
logs.PanicErr(err)
for _, v := range resp.List {

View File

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

View File

@@ -10,7 +10,12 @@ import (
func main() {
common.Test(func(c *tdx.Client) {
resp, err := c.GetStockMinuteTrade(protocol.ExchangeSH, "000001", 0, 100)
resp, err := c.GetMinuteTrade(protocol.MinuteTradeReq{
Exchange: protocol.ExchangeSZ,
Code: "000001",
Start: 0,
Count: 100,
})
logs.PanicErr(err)
for _, v := range resp.List {

View File

@@ -21,9 +21,9 @@ func main() {
b1cb74001c00000000000d005100bd00789c6378c1cecb252ace6066c5b4898987b9050ed1f90cc5b74c18a5bc18c1b43490fecff09c81819191f13fc3c9f3bb169f5e7dfefeb5ef57f7199a305009308208e5b32bb6bcbf70148712002d7f1e13
b1cb74000c02000000003e05ac00ac000102020000303030303031601294121a1c2d4eadabcf0ed412aae5fc01afb0024561124fbcc08301afa47900b2e3174100bf68871a4201b741b6144302bb09af334403972e96354504ac09b619560e00000000f8ff601201363030303038b60fba04060607429788a70efa04ada37ab2531c12974d91e7449dbc354184b6010001844bad324102b5679ea1014203a65abd8d0143048a6ba4dd01440587e101b3d2029613000000000000b60f
*/
resp, err := c.GetStockQuotes(map[protocol.Exchange]string{
protocol.ExchangeSH: "000001",
protocol.ExchangeSZ: "600008",
resp, err := c.GetQuote(map[protocol.Exchange]string{
protocol.ExchangeSZ: "000001",
protocol.ExchangeSH: "600008",
})
logs.PanicErr(err)