mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bollmaker: call persistence.Sync when position is changed
This commit is contained in:
parent
50d7d235a4
commit
7fce6a0fca
|
@ -632,6 +632,10 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
s.tradeCollector.OnPositionUpdate(func(position *types.Position) {
|
||||
log.Infof("position changed: %s", s.Position)
|
||||
s.Notify(s.Position)
|
||||
|
||||
if err := s.Persistence.Sync(s); err != nil {
|
||||
log.WithError(err).Errorf("can not sync state to persistence")
|
||||
}
|
||||
})
|
||||
|
||||
s.tradeCollector.BindStream(session.UserDataStream)
|
||||
|
|
Loading…
Reference in New Issue
Block a user