move OrderPriceRiskControl to riskcontrol

This commit is contained in:
narumi 2024-05-20 15:13:23 +08:00
parent 5f096bbe0d
commit 8ad85fc365
3 changed files with 6 additions and 4 deletions

View File

@ -1,9 +1,10 @@
package xfixedmaker
package riskcontrol
import (
"github.com/c9s/bbgo/pkg/fixedpoint"
indicatorv2 "github.com/c9s/bbgo/pkg/indicator/v2"
"github.com/c9s/bbgo/pkg/types"
log "github.com/sirupsen/logrus"
)
type OrderPriceRiskControl struct {

View File

@ -1,4 +1,4 @@
package xfixedmaker
package riskcontrol
import (
"testing"

View File

@ -9,6 +9,7 @@ import (
"github.com/c9s/bbgo/pkg/bbgo"
"github.com/c9s/bbgo/pkg/fixedpoint"
"github.com/c9s/bbgo/pkg/risk/riskcontrol"
"github.com/c9s/bbgo/pkg/strategy/common"
"github.com/c9s/bbgo/pkg/types"
)
@ -42,7 +43,7 @@ type Strategy struct {
market types.Market
activeOrderBook *bbgo.ActiveOrderBook
orderPriceRiskControl *OrderPriceRiskControl
orderPriceRiskControl *riskcontrol.OrderPriceRiskControl
}
func (s *Strategy) Defaults() error {
@ -120,7 +121,7 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se
s.Strategy.Initialize(ctx, s.Environment, tradingSession, s.market, ID, s.InstanceID())
s.orderPriceRiskControl = NewOrderPriceRiskControl(
s.orderPriceRiskControl = riskcontrol.NewOrderPriceRiskControl(
referenceSession.Indicators(s.Symbol).EMA(s.ReferencePriceEMA),
s.OrderPriceLossThreshold,
)