Compare commits

..

No commits in common. "ee9998034faaf46e058c4bbe01cf49fc5b39efa1" and "9b3daa43f3017240038c82004a0c2a1d241a6f6e" have entirely different histories.

4 changed files with 29 additions and 32 deletions

View File

@ -37,9 +37,6 @@
"index": 0,
"description": ""
},
"sortedSet": {
"length": 3000
},
"credentialReadOnly": {
"secretKey": "D6D74DF9DD60A25BE2B27CA71D8F814D",
"baseUrl": "https://aws.okx.com",
@ -104,7 +101,7 @@
"seg": "4H"
},
{
"startTime": "2024-05-27 06:00.000",
"startTime": "2021-12-04 18:00.000",
"enabled": true,
"seg": "6H"
},
@ -119,7 +116,7 @@
"seg": "1D"
},
{
"startTime": "2021-12-05 00:00.000",
"startTime": "2021-12-04 00:00.000",
"enabled": true,
"seg": "2D"
},

4
go.mod
View File

@ -4,8 +4,8 @@ go 1.21
require (
github.com/bitly/go-simplejson v0.5.0
github.com/phyer/core v0.2.18
github.com/phyer/v5sdkgo v0.1.5
github.com/phyer/core v0.2.15
github.com/phyer/v5sdkgo v0.1.4
github.com/sirupsen/logrus v1.9.3
)

8
go.sum
View File

@ -45,10 +45,10 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c=
github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
github.com/phyer/core v0.2.18 h1:kgAH4FSugwZisR1yIzq4Ru+qAU13/yQLNwCooEfzWq8=
github.com/phyer/core v0.2.18/go.mod h1:XZdniJiiZPzOU8+QHPFRQWdvJa6m5Ilj5VClWWI0OQg=
github.com/phyer/v5sdkgo v0.1.5 h1:lscP37ZMzVj/LJcmatYbJ7VvPXQZUgDX59Fghe2381g=
github.com/phyer/v5sdkgo v0.1.5/go.mod h1:QCMnQFQNizOvFRPKytv50fOg/MoxS44IFcQicc4NxOg=
github.com/phyer/core v0.2.6 h1:zLNgJ3PP4s5EvSC40RLXw0QptnvkbXwRBwvWHVCWVfA=
github.com/phyer/core v0.2.6/go.mod h1:XZdniJiiZPzOU8+QHPFRQWdvJa6m5Ilj5VClWWI0OQg=
github.com/phyer/v5sdkgo v0.1.4 h1:mAxxjPJVTYGuGDarqOcFGkzj5AgqbbzJGsnYmmsbapU=
github.com/phyer/v5sdkgo v0.1.4/go.mod h1:QCMnQFQNizOvFRPKytv50fOg/MoxS44IFcQicc4NxOg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=

30
main.go
View File

@ -209,14 +209,14 @@ func LoopAllCoinsList(mdura int, barPeriod string, rge int) {
var ct int
randVal := rand.Float64()
switch {
case randVal < 0.3:
// 30%的概率获取最近15%的数据
case randVal < 0.7:
// 70%的概率获取最近15%的数据
ct = rand.Intn(rge * 15 / 100)
case randVal < 0.5:
case randVal < 0.9:
// 20%的概率获取最近15%~55%的数据
ct = rand.Intn(rge*40/100) + (rge * 15 / 100)
default:
// 50%的概率获取最近55%~100%的数据
// 10%的概率获取最近55%~100%的数据
ct = rand.Intn(rge*45/100) + (rge * 55 / 100)
}
@ -258,57 +258,57 @@ func main() {
// 全员5m
go func() {
logrus.Info("LoopAllCoinsList - 5m")
LoopAllCoinsList(300, "5m", 10220)
LoopAllCoinsList(360, "5m", 20)
}()
// 全员15m candle
go func() {
logrus.Info("LoopAllCoinsList - 15m")
LoopAllCoinsList(300, "15m", 9430)
LoopAllCoinsList(720, "15m", 30)
}()
// 全员30m candle
go func() {
logrus.Info("LoopAllCoinsList - 30m")
LoopAllCoinsList(300, "30m", 7350)
LoopAllCoinsList(1200, "30m", 50)
}()
// 全员1H candle
go func() {
logrus.Info("LoopAllCoinsList - 1H")
LoopAllCoinsList(300, "1H", 4300)
LoopAllCoinsList(1800, "1H", 60)
}()
// 全员2H candle
go func() {
logrus.Info("LoopAllCoinsList - 2H")
LoopAllCoinsList(300, "2H", 4080)
LoopAllCoinsList(2400, "2H", 80)
}()
// 全员4小时candle
go func() {
logrus.Info("LoopAllCoinsList - 4H")
LoopAllCoinsList(300, "4H", 4100)
LoopAllCoinsList(3000, "4H", 100)
}()
// 全员6小时candle
go func() {
logrus.Info("LoopAllCoinsList - 6H")
LoopAllCoinsList(360, "6H", 3120)
LoopAllCoinsList(3600, "6H", 120)
}()
// 全员12小时candle
go func() {
logrus.Info("LoopAllCoinsList - 12H")
LoopAllCoinsList(360, "12H", 3160)
LoopAllCoinsList(4200, "12H", 160)
}()
// 全员1Day candle & maX
go func() {
logrus.Info("LoopAllCoinsList - 1D")
LoopAllCoinsList(400, "1D", 2180)
LoopAllCoinsList(4800, "1D", 180)
}()
// 全员2Day candle & maX
go func() {
logrus.Info("LoopAllCoinsList - 2D")
LoopAllCoinsList(400, "2D", 1220)
LoopAllCoinsList(6000, "2D", 220)
}()
// 全员5Day candle & maX
go func() {
logrus.Info("LoopAllCoinsList - 5D")
LoopAllCoinsList(420, "5D", 1240)
LoopAllCoinsList(7200, "5D", 240)
}()
go func() {
LoopSaveCandle(&cr)