diff --git a/pkg/strategy/rsmaker/strategy.go b/pkg/strategy/rsmaker/strategy.go index 3233fa3d5..0bce3fca5 100644 --- a/pkg/strategy/rsmaker/strategy.go +++ b/pkg/strategy/rsmaker/strategy.go @@ -36,11 +36,6 @@ func init() { bbgo.RegisterStrategy(ID, &Strategy{}) } -type BollingerSetting struct { - types.IntervalWindow - BandWidth float64 `json:"bandWidth"` -} - type Strategy struct { *bbgo.Graceful *bbgo.Notifiability @@ -108,11 +103,11 @@ type Strategy struct { // NeutralBollinger is the smaller range of the bollinger band // If price is in this band, it usually means the price is oscillating. // If price goes out of this band, we tend to not place sell orders or buy orders - NeutralBollinger *BollingerSetting `json:"neutralBollinger"` + NeutralBollinger *types.BollingerSetting `json:"neutralBollinger"` // DefaultBollinger is the wide range of the bollinger band // for controlling your exposure position - DefaultBollinger *BollingerSetting `json:"defaultBollinger"` + DefaultBollinger *types.BollingerSetting `json:"defaultBollinger"` // DowntrendSkew is the order quantity skew for normal downtrend band. // The price is still in the default bollinger band. diff --git a/pkg/types/bollinger.go b/pkg/types/bollinger.go new file mode 100644 index 000000000..9e7f4b82c --- /dev/null +++ b/pkg/types/bollinger.go @@ -0,0 +1,8 @@ +package types + +// BollingerSetting contains the bollinger indicator setting propers +// Interval, Window and BandWidth +type BollingerSetting struct { + IntervalWindow + BandWidth float64 `json:"bandWidth"` +}