mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: defer EmitCloseGrid callback earlier
This commit is contained in:
parent
7ba0e86605
commit
f039c97e63
|
@ -776,6 +776,8 @@ func (s *Strategy) OpenGrid(ctx context.Context) error {
|
|||
func (s *Strategy) CloseGrid(ctx context.Context) error {
|
||||
s.logger.Infof("closing %s grid", s.Symbol)
|
||||
|
||||
defer s.EmitGridClosed()
|
||||
|
||||
bbgo.Sync(ctx, s)
|
||||
|
||||
// now we can cancel the open orders
|
||||
|
@ -786,7 +788,6 @@ func (s *Strategy) CloseGrid(ctx context.Context) error {
|
|||
|
||||
// free the grid object
|
||||
s.setGrid(nil)
|
||||
s.EmitGridClosed()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user