mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: expose order group ID field
This commit is contained in:
parent
0b73520371
commit
760fc74187
|
@ -115,6 +115,9 @@ type Strategy struct {
|
|||
// PrometheusLabels will be used as the base prometheus labels
|
||||
PrometheusLabels prometheus.Labels `json:"prometheusLabels"`
|
||||
|
||||
// OrderGroupID is the group ID used for the strategy instance for canceling orders
|
||||
OrderGroupID uint32 `json:"orderGroupID"`
|
||||
|
||||
// FeeRate is used for calculating the minimal profit spread.
|
||||
// it makes sure that your grid configuration is profitable.
|
||||
FeeRate fixedpoint.Value `json:"feeRate"`
|
||||
|
@ -131,9 +134,6 @@ type Strategy struct {
|
|||
orderExecutor OrderExecutor
|
||||
historicalTrades *bbgo.TradeStore
|
||||
|
||||
// groupID is the group ID used for the strategy instance for canceling orders
|
||||
groupID uint32
|
||||
|
||||
logger *logrus.Entry
|
||||
|
||||
gridReadyCallbacks []func()
|
||||
|
@ -1328,7 +1328,9 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
|||
"symbol": s.Symbol,
|
||||
})
|
||||
|
||||
s.groupID = util.FNV32(instanceID)
|
||||
if s.OrderGroupID == 0 {
|
||||
s.OrderGroupID = util.FNV32(instanceID)
|
||||
}
|
||||
|
||||
if s.AutoRange != nil {
|
||||
indicatorSet := session.StandardIndicatorSet(s.Symbol)
|
||||
|
|
Loading…
Reference in New Issue
Block a user