trigger position opening immediately after recovery

This commit is contained in:
kbearXD 2024-05-13 15:24:26 +08:00
parent f49924caa4
commit e856727e97

View File

@ -334,6 +334,11 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
// start to sync periodically
go s.syncPeriodically(ctx)
// try to trigger position opening immediately
if s.state == WaitToOpenPosition {
s.emitNextState(PositionOpening)
}
// start running state machine
s.runState(ctx)
}