mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f381d72ec4 | ||
|
|
5fa572f298 | ||
|
|
61b2e737b3 | ||
|
|
5654065954 |
@@ -293,6 +293,7 @@ func (this Klines) Merge(n int) Klines {
|
|||||||
if n <= 1 {
|
if n <= 1 {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
ks := Klines(nil)
|
ks := Klines(nil)
|
||||||
ls := Klines(nil)
|
ls := Klines(nil)
|
||||||
for i := 0; ; i++ {
|
for i := 0; ; i++ {
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ func (this Trades) klinesForDay(date time.Time) Klines {
|
|||||||
//分组,按
|
//分组,按
|
||||||
for _, v := range this {
|
for _, v := range this {
|
||||||
ms := minutes(v.Time)
|
ms := minutes(v.Time)
|
||||||
t := conv.Select(ms <= _930, _930, ms)
|
t := conv.Select(ms < _930, _930, ms)
|
||||||
t++
|
t++
|
||||||
t = conv.Select(t > _1130 && t <= _1300, _1130, t)
|
t = conv.Select(t > _1130 && t <= _1300, _1130, t)
|
||||||
t = conv.Select(t > _1500, _1500, t)
|
t = conv.Select(t > _1500, _1500, t)
|
||||||
|
|||||||
@@ -150,11 +150,11 @@ func (this *Workday) RangeYear(year int, f func(t time.Time) bool) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Range 遍历指定范围的工作日
|
// Range 遍历指定范围的工作日,推荐start带上时间15:00,这样当天小于15点不会触发
|
||||||
func (this *Workday) Range(start, end time.Time, f func(t time.Time) bool) {
|
func (this *Workday) Range(start, end time.Time, f func(t time.Time) bool) {
|
||||||
start = conv.Select(start.Before(protocol.ExchangeEstablish), protocol.ExchangeEstablish, start)
|
start = conv.Select(start.Before(protocol.ExchangeEstablish), protocol.ExchangeEstablish, start)
|
||||||
now := IntegerDay(time.Now())
|
//now := IntegerDay(time.Now())
|
||||||
end = conv.Select(end.After(now), now, end).Add(1)
|
//end = conv.Select(end.After(now), now, end).Add(1)
|
||||||
for ; start.Before(end); start = start.Add(time.Hour * 24) {
|
for ; start.Before(end); start = start.Add(time.Hour * 24) {
|
||||||
if this.Is(start) {
|
if this.Is(start) {
|
||||||
if !f(start) {
|
if !f(start) {
|
||||||
|
|||||||
Reference in New Issue
Block a user