mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 11:03:53 +00:00
28 lines
680 B
Go
28 lines
680 B
Go
|
// Code generated by "callbackgen -type ExchangeOrderExecutor"; DO NOT EDIT.
|
||
|
|
||
|
package bbgo
|
||
|
|
||
|
import (
|
||
|
"github.com/c9s/bbgo/pkg/types"
|
||
|
)
|
||
|
|
||
|
func (e *ExchangeOrderExecutor) OnTradeUpdate(cb func(trade types.Trade)) {
|
||
|
e.tradeUpdateCallbacks = append(e.tradeUpdateCallbacks, cb)
|
||
|
}
|
||
|
|
||
|
func (e *ExchangeOrderExecutor) EmitTradeUpdate(trade types.Trade) {
|
||
|
for _, cb := range e.tradeUpdateCallbacks {
|
||
|
cb(trade)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (e *ExchangeOrderExecutor) OnOrderUpdate(cb func(order types.Order)) {
|
||
|
e.orderUpdateCallbacks = append(e.orderUpdateCallbacks, cb)
|
||
|
}
|
||
|
|
||
|
func (e *ExchangeOrderExecutor) EmitOrderUpdate(order types.Order) {
|
||
|
for _, cb := range e.orderUpdateCallbacks {
|
||
|
cb(order)
|
||
|
}
|
||
|
}
|