bbgo_origin/pkg/strategy/grid2/strategy_callbacks.go

36 lines
788 B
Go
Raw Normal View History

2022-12-26 10:15:39 +00:00
// Code generated by "callbackgen -type Strategy"; DO NOT EDIT.
package grid2
import ()
func (s *Strategy) OnGridReady(cb func()) {
s.gridReadyCallbacks = append(s.gridReadyCallbacks, cb)
}
func (s *Strategy) EmitGridReady() {
for _, cb := range s.gridReadyCallbacks {
cb()
}
}
func (s *Strategy) OnGridProfit(cb func(stats *GridProfitStats, profit *GridProfit)) {
s.gridProfitCallbacks = append(s.gridProfitCallbacks, cb)
}
func (s *Strategy) EmitGridProfit(stats *GridProfitStats, profit *GridProfit) {
for _, cb := range s.gridProfitCallbacks {
cb(stats, profit)
}
}
func (s *Strategy) OnGridClosed(cb func()) {
s.gridClosedCallbacks = append(s.gridClosedCallbacks, cb)
}
func (s *Strategy) EmitGridClosed() {
for _, cb := range s.gridClosedCallbacks {
cb()
}
}