Compare commits

...

1 Commits

Author SHA1 Message Date
injoyai
ed2c814fab 增加指数分钟k线的方法 2025-11-19 15:57:02 +08:00

View File

@@ -3,6 +3,10 @@ package tdx
import ( import (
"errors" "errors"
"fmt" "fmt"
"runtime/debug"
"sync/atomic"
"time"
"github.com/injoyai/base/maps" "github.com/injoyai/base/maps"
"github.com/injoyai/base/maps/wait" "github.com/injoyai/base/maps/wait"
"github.com/injoyai/conv" "github.com/injoyai/conv"
@@ -12,9 +16,6 @@ import (
"github.com/injoyai/logs" "github.com/injoyai/logs"
"github.com/injoyai/tdx/internal/bse" "github.com/injoyai/tdx/internal/bse"
"github.com/injoyai/tdx/protocol" "github.com/injoyai/tdx/protocol"
"runtime/debug"
"sync/atomic"
"time"
) )
const ( const (
@@ -560,6 +561,26 @@ func (this *Client) GetIndexAll(Type uint8, code string) (*protocol.KlineResp, e
return this.GetIndexUntil(Type, code, func(k *protocol.Kline) bool { return false }) return this.GetIndexUntil(Type, code, func(k *protocol.Kline) bool { return false })
} }
func (this *Client) GetIndexMinute(code string, start, count uint16) (*protocol.KlineResp, error) {
return this.GetIndex(protocol.TypeKlineMinute, code, start, count)
}
func (this *Client) GetIndex5Minute(code string, start, count uint16) (*protocol.KlineResp, error) {
return this.GetIndex(protocol.TypeKline5Minute, code, start, count)
}
func (this *Client) GetIndex15Minute(code string, start, count uint16) (*protocol.KlineResp, error) {
return this.GetIndex(protocol.TypeKline15Minute, code, start, count)
}
func (this *Client) GetIndex30Minute(code string, start, count uint16) (*protocol.KlineResp, error) {
return this.GetIndex(protocol.TypeKline30Minute, code, start, count)
}
func (this *Client) GetIndex60Minute(code string, start, count uint16) (*protocol.KlineResp, error) {
return this.GetIndex(protocol.TypeKline60Minute, code, start, count)
}
func (this *Client) GetIndexDay(code string, start, count uint16) (*protocol.KlineResp, error) { func (this *Client) GetIndexDay(code string, start, count uint16) (*protocol.KlineResp, error) {
return this.GetIndex(protocol.TypeKlineDay, code, start, count) return this.GetIndex(protocol.TypeKlineDay, code, start, count)
} }