From a8d678a544f90a3e67cfd7a3a90ac15c0d407b5d Mon Sep 17 00:00:00 2001 From: narumi Date: Wed, 11 Oct 2023 15:50:44 +0800 Subject: [PATCH] rename randomtrader to random --- config/{randomtrader.yaml => random.yaml} | 4 ++-- pkg/cmd/strategy/builtin.go | 2 +- pkg/strategy/{randomtrader => random}/strategy.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename config/{randomtrader.yaml => random.yaml} (84%) rename pkg/strategy/{randomtrader => random}/strategy.go (98%) diff --git a/config/randomtrader.yaml b/config/random.yaml similarity index 84% rename from config/randomtrader.yaml rename to config/random.yaml index 9212165cb..551e397fc 100644 --- a/config/randomtrader.yaml +++ b/config/random.yaml @@ -1,10 +1,10 @@ --- exchangeStrategies: - on: max - randomtrader: + random: symbol: USDCUSDT # https://pkg.go.dev/github.com/robfig/cron#hdr-Predefined_schedules - cronExpression: "@every 1m" + cronExpression: "@every 8h" quantity: 8 # adjust quantity by minimal notional and minimal quantity adjustQuantity: true diff --git a/pkg/cmd/strategy/builtin.go b/pkg/cmd/strategy/builtin.go index 212420099..d868e926a 100644 --- a/pkg/cmd/strategy/builtin.go +++ b/pkg/cmd/strategy/builtin.go @@ -29,7 +29,7 @@ import ( _ "github.com/c9s/bbgo/pkg/strategy/pivotshort" _ "github.com/c9s/bbgo/pkg/strategy/pricealert" _ "github.com/c9s/bbgo/pkg/strategy/pricedrop" - _ "github.com/c9s/bbgo/pkg/strategy/randomtrader" + _ "github.com/c9s/bbgo/pkg/strategy/random" _ "github.com/c9s/bbgo/pkg/strategy/rebalance" _ "github.com/c9s/bbgo/pkg/strategy/rsicross" _ "github.com/c9s/bbgo/pkg/strategy/rsmaker" diff --git a/pkg/strategy/randomtrader/strategy.go b/pkg/strategy/random/strategy.go similarity index 98% rename from pkg/strategy/randomtrader/strategy.go rename to pkg/strategy/random/strategy.go index 5402cfd56..f1bae583b 100644 --- a/pkg/strategy/randomtrader/strategy.go +++ b/pkg/strategy/random/strategy.go @@ -1,4 +1,4 @@ -package randomtrader +package random import ( "context" @@ -15,7 +15,7 @@ import ( "github.com/c9s/bbgo/pkg/types" ) -const ID = "randomtrader" +const ID = "random" var log = logrus.WithField("strategy", ID)