LoopAllCoin change

This commit is contained in:
zhangkun9038@dingtalk.com 2024-12-25 14:55:08 +08:00
parent bc8c103014
commit ffee253a5c

27
main.go
View File

@ -159,7 +159,7 @@ func ShowSysTime(cr *core.Core) {
// period: 每个循环开始的时间点,单位:秒 // period: 每个循环开始的时间点,单位:秒
// delay延时多少秒后去取此值, 单位:秒 // delay延时多少秒后去取此值, 单位:秒
// mdura多少个分钟之内遍历完获取到的goins列表, 单位:秒 // mdura多少个之内遍历完获取到的goins列表, 单位:秒
// barPeriod: 周期名字 // barPeriod: 周期名字
// onceCount每次获取这个coin几个当前周期的candle数据 // onceCount每次获取这个coin几个当前周期的candle数据
// range: 随机的范围从0开始到range个周期作为查询的after值也就是随机n个周期去取之前的记录,对于2D5D等数据可以用来补全数据, range值越大随机散点的范围越大, 越失焦 // range: 随机的范围从0开始到range个周期作为查询的after值也就是随机n个周期去取之前的记录,对于2D5D等数据可以用来补全数据, range值越大随机散点的范围越大, 越失焦
@ -209,8 +209,9 @@ func LoopAllCoinsList(period int64, delay int64, mdura int, barPeriod string, on
restQ := core.RestQueue{ restQ := core.RestQueue{
InstId: ary[i], InstId: ary[i],
Bar: barPeriod, Bar: barPeriod,
Duration: time.Duration(mdura/len(allScore)) * time.Second,
WithWs: false, WithWs: false,
Limit: core.ToString(core.ToInt64(onceCount)),
After: tmi, After: tmi,
} }
js, err := json.Marshal(restQ) js, err := json.Marshal(restQ)
@ -233,57 +234,57 @@ func main() {
// 全员5m // 全员5m
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(6, 0, 6, "5m", 6, 14) LoopAllCoinsList(6, 0, 6, "5m", 6, 32)
}() }()
// 全员15m candle // 全员15m candle
go func() { go func() {
fmt.Println("LoopAllCoinsList2") fmt.Println("LoopAllCoinsList2")
LoopAllCoinsList(19, 90, 19, "15m", 4, 14) LoopAllCoinsList(19, 90, 19, "15m", 10, 33)
}() }()
// 全员30m candle // 全员30m candle
go func() { go func() {
fmt.Println("LoopAllCoinsList2") fmt.Println("LoopAllCoinsList2")
LoopAllCoinsList(25, 0, 25, "30m", 5, 16) LoopAllCoinsList(25, 0, 25, "30m", 15, 34)
}() }()
// 全员1H candle // 全员1H candle
go func() { go func() {
fmt.Println("LoopAllCoinsList2") fmt.Println("LoopAllCoinsList2")
LoopAllCoinsList(38, 0, 38, "1H", 9, 18) LoopAllCoinsList(38, 0, 38, "1H", 15, 36)
}() }()
// 全员2H candle // 全员2H candle
go func() { go func() {
fmt.Println("LoopAllCoinsList2") fmt.Println("LoopAllCoinsList2")
LoopAllCoinsList(41, 0, 41, "2H", 12, 18) LoopAllCoinsList(41, 0, 41, "2H", 20, 37)
}() }()
// 全员4小时candle // 全员4小时candle
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(69, 0, 69, "4H", 15, 18) LoopAllCoinsList(69, 0, 69, "4H", 20, 38)
}() }()
// 全员6小时candle // 全员6小时candle
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(72, 0, 72, "6H", 17, 20) LoopAllCoinsList(72, 0, 72, "6H", 20, 41)
}() }()
// 全员12小时candle // 全员12小时candle
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(89, 0, 88, "12H", 19, 20) LoopAllCoinsList(89, 0, 88, "12H", 25, 43)
}() }()
// 全员1Day candle & maX // 全员1Day candle & maX
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(94, 4, 94, "1D", 25, 22) LoopAllCoinsList(94, 4, 94, "1D", 25, 45)
}() }()
// 全员2Day candle & maX // 全员2Day candle & maX
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(192, 4, 192, "2D", 26, 24) LoopAllCoinsList(192, 4, 192, "2D", 25, 47)
}() }()
// 全员5Day candle & maX // 全员5Day candle & maX
go func() { go func() {
fmt.Println("LoopAllCoinsList1") fmt.Println("LoopAllCoinsList1")
LoopAllCoinsList(320, 4, 320, "5D", 28, 26) LoopAllCoinsList(320, 4, 320, "5D", 30, 49)
}() }()
go func() { go func() {
LoopSaveCandle(&cr) LoopSaveCandle(&cr)