Skip to content

Commit 4e47278

Browse files
committed
Update
1 parent 640dfe9 commit 4e47278

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

strategy.go

+10
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ type CStrategyBase struct {
164164
tradeMode TradeMode
165165
Exchanges []Exchange
166166
SpotExchanges []SpotExchange
167+
stopped bool
167168
}
168169

169170
// SetSelf 设置 self 对象
@@ -188,6 +189,7 @@ func (s *CStrategyBase) Setup(mode TradeMode, exchanges ...interface{}) error {
188189
s.SpotExchanges = append(s.SpotExchanges, ex)
189190
}
190191
}
192+
s.stopped = false
191193
return nil
192194
}
193195

@@ -205,6 +207,14 @@ func (s *CStrategyBase) TradeMode() TradeMode {
205207
return s.tradeMode
206208
}
207209

210+
func (s *CStrategyBase) IsStopped() bool {
211+
return s.stopped
212+
}
213+
214+
func (s *CStrategyBase) StopNow() {
215+
s.stopped = true
216+
}
217+
208218
func (s *CStrategyBase) SetName(name string) {
209219
s.name = name
210220
}

0 commit comments

Comments
 (0)