mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
refactor order executor accessors
This commit is contained in:
parent
c605761c4f
commit
eaaab914e0
|
@ -33,6 +33,14 @@ type BaseOrderExecutor struct {
|
|||
orderStore *core.OrderStore
|
||||
}
|
||||
|
||||
func (e *BaseOrderExecutor) OrderStore() *core.OrderStore {
|
||||
return e.orderStore
|
||||
}
|
||||
|
||||
func (e *BaseOrderExecutor) ActiveMakerOrders() *ActiveOrderBook {
|
||||
return e.activeMakerOrders
|
||||
}
|
||||
|
||||
// GeneralOrderExecutor implements the general order executor for strategy
|
||||
type GeneralOrderExecutor struct {
|
||||
BaseOrderExecutor
|
||||
|
@ -131,14 +139,6 @@ func (e *GeneralOrderExecutor) marginAssetMaxBorrowableUpdater(ctx context.Conte
|
|||
}
|
||||
}
|
||||
|
||||
func (e *GeneralOrderExecutor) OrderStore() *core.OrderStore {
|
||||
return e.orderStore
|
||||
}
|
||||
|
||||
func (e *GeneralOrderExecutor) ActiveMakerOrders() *ActiveOrderBook {
|
||||
return e.activeMakerOrders
|
||||
}
|
||||
|
||||
func (e *GeneralOrderExecutor) BindEnvironment(environ *Environment) {
|
||||
e.tradeCollector.OnProfit(func(trade types.Trade, profit *types.Profit) {
|
||||
environ.RecordPosition(e.position, trade, profit)
|
||||
|
|
Loading…
Reference in New Issue
Block a user