From 5fa572f298f99dd1bc369685b16fad7ae46a82e2 Mon Sep 17 00:00:00 2001 From: injoyai <1113655791@qq.com> Date: Tue, 28 Oct 2025 08:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E9=9B=86=E5=90=88=E7=AB=9E=E4=BB=B7?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=88=B0931=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/model_kline.go | 6 ------ protocol/model_trade.go | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/protocol/model_kline.go b/protocol/model_kline.go index 26d83a0..6c05083 100644 --- a/protocol/model_kline.go +++ b/protocol/model_kline.go @@ -295,12 +295,6 @@ func (this Klines) Merge(n int) Klines { } ks := Klines(nil) - - if this[0].Time.Hour() == 9 && this[0].Time.Minute() == 30 { - ks = append(ks, this[0]) - this = this[1:] - } - ls := Klines(nil) for i := 0; ; i++ { if len(this) <= i*n { diff --git a/protocol/model_trade.go b/protocol/model_trade.go index 2babcf7..74a9423 100644 --- a/protocol/model_trade.go +++ b/protocol/model_trade.go @@ -183,7 +183,6 @@ func (this Trades) Kline(t time.Time, last Price) *Kline { // kline1 生成一分钟k线,一天 func (this Trades) klinesForDay(date time.Time) Klines { - _929 := 569 //9:29 的分钟,为了兼容性强,把9:25算9:29 _930 := 570 //9:30 的分钟 _1130 := 690 //11:30 的分钟 _1300 := 780 //13:00 的分钟 @@ -191,7 +190,7 @@ func (this Trades) klinesForDay(date time.Time) Klines { keys := []int(nil) //早上 m := map[int]Trades{} - for i := 0; i <= 120; i++ { + for i := 1; i <= 120; i++ { keys = append(keys, _930+i) m[_930+i] = []*Trade{} } @@ -211,7 +210,7 @@ func (this Trades) klinesForDay(date time.Time) Klines { //分组,按 for _, v := range this { ms := minutes(v.Time) - t := conv.Select(ms < _929, _929, 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)