mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
fix
This commit is contained in:
parent
c8becbe4f5
commit
7de49155eb
|
@ -44,6 +44,9 @@ func newGridProfitStats(market types.Market) *GridProfitStats {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GridProfitStats) SetTTL(ttl time.Duration) {
|
func (s *GridProfitStats) SetTTL(ttl time.Duration) {
|
||||||
|
if ttl.Nanoseconds() <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
s.ttl = ttl
|
s.ttl = ttl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1836,7 +1836,7 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
||||||
s.ProfitSpread = s.Market.TruncatePrice(s.ProfitSpread)
|
s.ProfitSpread = s.Market.TruncatePrice(s.ProfitSpread)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.logger.Infof("ttl: %s", s.PersistenceTTL.Duration())
|
s.logger.Infof("persistence ttl: %s", s.PersistenceTTL.Duration())
|
||||||
|
|
||||||
if s.GridProfitStats == nil {
|
if s.GridProfitStats == nil {
|
||||||
s.GridProfitStats = newGridProfitStats(s.Market)
|
s.GridProfitStats = newGridProfitStats(s.Market)
|
||||||
|
|
|
@ -71,6 +71,9 @@ type Position struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Position) SetTTL(ttl time.Duration) {
|
func (s *Position) SetTTL(ttl time.Duration) {
|
||||||
|
if ttl.Nanoseconds() <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
s.ttl = ttl
|
s.ttl = ttl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user