mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
move OrderPriceRiskControl to riskcontrol
This commit is contained in:
parent
5f096bbe0d
commit
8ad85fc365
|
@ -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 {
|
|
@ -1,4 +1,4 @@
|
|||
package xfixedmaker
|
||||
package riskcontrol
|
||||
|
||||
import (
|
||||
"testing"
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user