get index bar

This commit is contained in:
bense
2022-05-10 16:37:44 +08:00
parent 0172cdb00e
commit 5ff1b4fe05
10 changed files with 637 additions and 82 deletions

View File

@@ -44,14 +44,7 @@ func Test_tdx_GetSecurityCount(t *testing.T) {
}
fmt.Println(reply)
reply, err = api.GetSecurityCount(MarketSz)
if err != nil {
fmt.Println(err)
}
fmt.Println(reply)
_ = api.Disconnect()
}
func Test_tdx_GetSecurityQuotes(t *testing.T) {
@@ -69,3 +62,51 @@ func Test_tdx_GetSecurityQuotes(t *testing.T) {
_ = api.Disconnect()
}
func Test_tdx_GetSecurityList(t *testing.T) {
api := prepare()
reply, err := api.GetSecurityList(MarketSh, 0)
if err != nil {
fmt.Println(err)
}
fmt.Println(reply)
_ = api.Disconnect()
}
func Test_tdx_GetSecurityBars(t *testing.T) {
// GetSecurityBars 与 GetIndexBars 使用同一个接口靠market区分
api := prepare()
reply, err := api.GetSecurityBars(proto.KLINE_TYPE_RI_K, 0, "000001", 0, 10)
if err != nil {
fmt.Println(err)
}
fmt.Println(reply)
for _, bar := range reply.List {
fmt.Println(bar)
}
_ = api.Disconnect()
}
func Test_tdx_GetIndexBars(t *testing.T) {
// GetSecurityBars 与 GetIndexBars 使用同一个接口靠market区分
api := prepare()
reply, err := api.GetIndexBars(proto.KLINE_TYPE_RI_K, 1, "000001", 0, 10)
if err != nil {
fmt.Println(err)
}
fmt.Println(reply)
for _, bar := range reply.List {
fmt.Println(bar)
}
_ = api.Disconnect()
}