strategy: add PositionReader function for support strategy

This commit is contained in:
Andy Cheng 2022-03-15 16:46:27 +08:00
parent b94096cb2e
commit 231085d507
No known key found for this signature in database
GPG Key ID: 936427CF651A9D28

View File

@ -207,6 +207,10 @@ func (s *Strategy) Subscribe(session *bbgo.ExchangeSession) {
}
}
func (s *Strategy) CurrentPosition() *types.Position {
return s.state.Position
}
func (s *Strategy) SaveState() error {
if err := s.Persistence.Save(s.state, ID, s.Symbol, stateKey); err != nil {
return err