mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 23:35:14 +00:00
38 lines
971 B
Go
38 lines
971 B
Go
// Code generated by "callbackgen -type SimplePriceMatching"; DO NOT EDIT.
|
|
|
|
package backtest
|
|
|
|
import (
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
)
|
|
|
|
func (m *SimplePriceMatching) OnTradeUpdate(cb func(trade types.Trade)) {
|
|
m.tradeUpdateCallbacks = append(m.tradeUpdateCallbacks, cb)
|
|
}
|
|
|
|
func (m *SimplePriceMatching) EmitTradeUpdate(trade types.Trade) {
|
|
for _, cb := range m.tradeUpdateCallbacks {
|
|
cb(trade)
|
|
}
|
|
}
|
|
|
|
func (m *SimplePriceMatching) OnOrderUpdate(cb func(order types.Order)) {
|
|
m.orderUpdateCallbacks = append(m.orderUpdateCallbacks, cb)
|
|
}
|
|
|
|
func (m *SimplePriceMatching) EmitOrderUpdate(order types.Order) {
|
|
for _, cb := range m.orderUpdateCallbacks {
|
|
cb(order)
|
|
}
|
|
}
|
|
|
|
func (m *SimplePriceMatching) OnBalanceUpdate(cb func(balances types.BalanceMap)) {
|
|
m.balanceUpdateCallbacks = append(m.balanceUpdateCallbacks, cb)
|
|
}
|
|
|
|
func (m *SimplePriceMatching) EmitBalanceUpdate(balances types.BalanceMap) {
|
|
for _, cb := range m.balanceUpdateCallbacks {
|
|
cb(balances)
|
|
}
|
|
}
|