From 5f096bbe0d8f3f48fcf95838d9c7ab69eb50bc87 Mon Sep 17 00:00:00 2001 From: narumi Date: Mon, 20 May 2024 15:11:18 +0800 Subject: [PATCH] move InventorySkew to strategy.common --- pkg/strategy/{fixedmaker => common}/inventory_skew.go | 2 +- .../{fixedmaker => common}/inventory_skew_test.go | 2 +- pkg/strategy/fixedmaker/strategy.go | 2 +- pkg/strategy/xfixedmaker/strategy.go | 9 ++++----- 4 files changed, 7 insertions(+), 8 deletions(-) rename pkg/strategy/{fixedmaker => common}/inventory_skew.go (98%) rename pkg/strategy/{fixedmaker => common}/inventory_skew_test.go (99%) diff --git a/pkg/strategy/fixedmaker/inventory_skew.go b/pkg/strategy/common/inventory_skew.go similarity index 98% rename from pkg/strategy/fixedmaker/inventory_skew.go rename to pkg/strategy/common/inventory_skew.go index dae68e7c4..48e47b951 100644 --- a/pkg/strategy/fixedmaker/inventory_skew.go +++ b/pkg/strategy/common/inventory_skew.go @@ -1,4 +1,4 @@ -package fixedmaker +package common import ( "fmt" diff --git a/pkg/strategy/fixedmaker/inventory_skew_test.go b/pkg/strategy/common/inventory_skew_test.go similarity index 99% rename from pkg/strategy/fixedmaker/inventory_skew_test.go rename to pkg/strategy/common/inventory_skew_test.go index cd40931a1..a0624a6e1 100644 --- a/pkg/strategy/fixedmaker/inventory_skew_test.go +++ b/pkg/strategy/common/inventory_skew_test.go @@ -1,4 +1,4 @@ -package fixedmaker +package common import ( "testing" diff --git a/pkg/strategy/fixedmaker/strategy.go b/pkg/strategy/fixedmaker/strategy.go index fd665ec16..6221bb1e0 100644 --- a/pkg/strategy/fixedmaker/strategy.go +++ b/pkg/strategy/fixedmaker/strategy.go @@ -35,7 +35,7 @@ type Strategy struct { OrderType types.OrderType `json:"orderType"` DryRun bool `json:"dryRun"` - InventorySkew InventorySkew `json:"inventorySkew"` + InventorySkew common.InventorySkew `json:"inventorySkew"` activeOrderBook *bbgo.ActiveOrderBook } diff --git a/pkg/strategy/xfixedmaker/strategy.go b/pkg/strategy/xfixedmaker/strategy.go index fe7e2a855..5a9a9db98 100644 --- a/pkg/strategy/xfixedmaker/strategy.go +++ b/pkg/strategy/xfixedmaker/strategy.go @@ -10,7 +10,6 @@ import ( "github.com/c9s/bbgo/pkg/bbgo" "github.com/c9s/bbgo/pkg/fixedpoint" "github.com/c9s/bbgo/pkg/strategy/common" - "github.com/c9s/bbgo/pkg/strategy/fixedmaker" "github.com/c9s/bbgo/pkg/types" ) @@ -36,10 +35,10 @@ type Strategy struct { OrderType types.OrderType `json:"orderType"` DryRun bool `json:"dryRun"` - ReferenceExchange string `json:"referenceExchange"` - ReferencePriceEMA types.IntervalWindow `json:"referencePriceEMA"` - OrderPriceLossThreshold fixedpoint.Value `json:"orderPriceLossThreshold"` - InventorySkew fixedmaker.InventorySkew `json:"inventorySkew"` + ReferenceExchange string `json:"referenceExchange"` + ReferencePriceEMA types.IntervalWindow `json:"referencePriceEMA"` + OrderPriceLossThreshold fixedpoint.Value `json:"orderPriceLossThreshold"` + InventorySkew common.InventorySkew `json:"inventorySkew"` market types.Market activeOrderBook *bbgo.ActiveOrderBook