mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
grid2: call bbgo sync api to sync profit stats
This commit is contained in:
parent
1964763f58
commit
c2133a1712
|
@ -1034,7 +1034,11 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
||||||
orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) {
|
orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) {
|
||||||
bbgo.Sync(ctx, s)
|
bbgo.Sync(ctx, s)
|
||||||
})
|
})
|
||||||
orderExecutor.ActiveMakerOrders().OnFilled(s.handleOrderFilled)
|
orderExecutor.ActiveMakerOrders().OnFilled(func(o types.Order) {
|
||||||
|
s.handleOrderFilled(o)
|
||||||
|
bbgo.Sync(context.Background(), s)
|
||||||
|
})
|
||||||
|
|
||||||
s.orderExecutor = orderExecutor
|
s.orderExecutor = orderExecutor
|
||||||
|
|
||||||
// TODO: detect if there are previous grid orders on the order book
|
// TODO: detect if there are previous grid orders on the order book
|
||||||
|
|
Loading…
Reference in New Issue
Block a user