mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
twap: handle delayInterval after canceling order
This commit is contained in:
parent
9a2b792ed1
commit
a0cbf82d97
|
@ -49,8 +49,6 @@ type FixedQuantityExecutor struct {
|
|||
executionCtx context.Context
|
||||
cancelExecution context.CancelFunc
|
||||
|
||||
orderUpdateRateLimit *rate.Limiter
|
||||
|
||||
userDataStreamCtx context.Context
|
||||
cancelUserDataStream context.CancelFunc
|
||||
|
||||
|
@ -61,10 +59,11 @@ type FixedQuantityExecutor struct {
|
|||
|
||||
userDataStream types.Stream
|
||||
|
||||
activeMakerOrders *bbgo.ActiveOrderBook
|
||||
orderStore *core.OrderStore
|
||||
position *types.Position
|
||||
tradeCollector *core.TradeCollector
|
||||
orderUpdateRateLimit *rate.Limiter
|
||||
activeMakerOrders *bbgo.ActiveOrderBook
|
||||
orderStore *core.OrderStore
|
||||
position *types.Position
|
||||
tradeCollector *core.TradeCollector
|
||||
|
||||
logger logrus.FieldLogger
|
||||
|
||||
|
@ -353,6 +352,10 @@ func (e *FixedQuantityExecutor) updateOrder(ctx context.Context) error {
|
|||
|
||||
e.tradeCollector.Process()
|
||||
|
||||
if e.delayInterval > 0 {
|
||||
time.Sleep(e.delayInterval)
|
||||
}
|
||||
|
||||
orderForm, err := e.generateOrder()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue
Block a user