Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
f0cii committed Sep 30, 2020
1 parent 640dfe9 commit 4e47278
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ type CStrategyBase struct {
tradeMode TradeMode
Exchanges []Exchange
SpotExchanges []SpotExchange
stopped bool
}

// SetSelf 设置 self 对象
Expand All @@ -188,6 +189,7 @@ func (s *CStrategyBase) Setup(mode TradeMode, exchanges ...interface{}) error {
s.SpotExchanges = append(s.SpotExchanges, ex)
}
}
s.stopped = false
return nil
}

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

func (s *CStrategyBase) IsStopped() bool {
return s.stopped
}

func (s *CStrategyBase) StopNow() {
s.stopped = true
}

func (s *CStrategyBase) SetName(name string) {
s.name = name
}
Expand Down

0 comments on commit 4e47278

Please sign in to comment.