mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
xdepthmaker: apply FullReplenishInterval from config
This commit is contained in:
parent
25b04cb36c
commit
d14527b5cf
|
@ -186,13 +186,14 @@ type Strategy struct {
|
|||
|
||||
UpdateInterval types.Duration `json:"updateInterval"`
|
||||
HedgeInterval types.Duration `json:"hedgeInterval"`
|
||||
|
||||
FullReplenishInterval types.Duration `json:"fullReplenishInterval"`
|
||||
|
||||
OrderCancelWaitTime types.Duration `json:"orderCancelWaitTime"`
|
||||
|
||||
Margin fixedpoint.Value `json:"margin"`
|
||||
BidMargin fixedpoint.Value `json:"bidMargin"`
|
||||
AskMargin fixedpoint.Value `json:"askMargin"`
|
||||
UseDepthPrice bool `json:"useDepthPrice"`
|
||||
DepthQuantity fixedpoint.Value `json:"depthQuantity"`
|
||||
|
||||
StopHedgeQuoteBalance fixedpoint.Value `json:"stopHedgeQuoteBalance"`
|
||||
StopHedgeBaseBalance fixedpoint.Value `json:"stopHedgeBaseBalance"`
|
||||
|
@ -286,6 +287,10 @@ func (s *Strategy) Defaults() error {
|
|||
s.UpdateInterval = types.Duration(time.Second)
|
||||
}
|
||||
|
||||
if s.FullReplenishInterval == 0 {
|
||||
s.FullReplenishInterval = types.Duration(15 * time.Minute)
|
||||
}
|
||||
|
||||
if s.HedgeInterval == 0 {
|
||||
s.HedgeInterval = types.Duration(3 * time.Second)
|
||||
}
|
||||
|
@ -363,7 +368,7 @@ func (s *Strategy) CrossRun(
|
|||
posTicker := time.NewTicker(util.MillisecondsJitter(s.HedgeInterval.Duration(), 200))
|
||||
defer posTicker.Stop()
|
||||
|
||||
fullReplenishTicker := time.NewTicker(util.MillisecondsJitter(15*time.Minute, 200))
|
||||
fullReplenishTicker := time.NewTicker(util.MillisecondsJitter(s.FullReplenishInterval.Duration(), 200))
|
||||
defer fullReplenishTicker.Stop()
|
||||
|
||||
for {
|
||||
|
|
Loading…
Reference in New Issue
Block a user