mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-27 01:05:15 +00:00
36 lines
788 B
Go
36 lines
788 B
Go
|
// 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()
|
||
|
}
|
||
|
}
|