Compare commits

..

5 Commits

Author SHA1 Message Date
injoyai
5fa572f298 把集合竞价合并到931里面 2025-10-28 08:41:04 +08:00
injoyai
61b2e737b3 把集合竞价从931剥离出来到930 2025-10-27 09:09:19 +08:00
injoyai
5654065954 把集合竞价从931剥离出来到930 2025-10-27 08:49:22 +08:00
injoyai
d7dd7fe0bf 优化extend.GetBjCodes,直接输出代码 2025-10-22 14:25:30 +08:00
injoyai
9fb1a3b651 增加SetTimeout 设置超时时间 2025-10-21 09:57:03 +08:00
4 changed files with 17 additions and 3 deletions

View File

@@ -181,6 +181,11 @@ func (this *Client) handlerDealMessage(c *client.Client, msg ios.Acker) {
}
// SetTimeout 设置超时时间
func (this *Client) SetTimeout(t time.Duration) {
this.Wait.SetTimeout(t)
}
// SendFrame 发送数据,并等待响应
func (this *Client) SendFrame(f *protocol.Frame, cache ...any) (any, error) {
f.MsgID = atomic.AddUint32(&this.msgID, 1)

View File

@@ -4,6 +4,14 @@ import (
"github.com/injoyai/tdx"
)
func GetBjCodes() ([]*tdx.BjCode, error) {
return tdx.GetBjCodes()
func GetBjCodes() ([]string, error) {
cs, err := tdx.GetBjCodes()
if err != nil {
return nil, err
}
ls := []string(nil)
for _, v := range cs {
ls = append(ls, "bj"+v.Code)
}
return ls, nil
}

View File

@@ -293,6 +293,7 @@ func (this Klines) Merge(n int) Klines {
if n <= 1 {
return this
}
ks := Klines(nil)
ls := Klines(nil)
for i := 0; ; i++ {

View File

@@ -210,7 +210,7 @@ func (this Trades) klinesForDay(date time.Time) Klines {
//分组,按
for _, v := range this {
ms := minutes(v.Time)
t := conv.Select(ms <= _930, _930, ms)
t := conv.Select(ms < _930, _930, ms)
t++
t = conv.Select(t > _1130 && t <= _1300, _1130, t)
t = conv.Select(t > _1500, _1500, t)