mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +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
|
executionCtx context.Context
|
||||||
cancelExecution context.CancelFunc
|
cancelExecution context.CancelFunc
|
||||||
|
|
||||||
orderUpdateRateLimit *rate.Limiter
|
|
||||||
|
|
||||||
userDataStreamCtx context.Context
|
userDataStreamCtx context.Context
|
||||||
cancelUserDataStream context.CancelFunc
|
cancelUserDataStream context.CancelFunc
|
||||||
|
|
||||||
|
@ -61,10 +59,11 @@ type FixedQuantityExecutor struct {
|
||||||
|
|
||||||
userDataStream types.Stream
|
userDataStream types.Stream
|
||||||
|
|
||||||
activeMakerOrders *bbgo.ActiveOrderBook
|
orderUpdateRateLimit *rate.Limiter
|
||||||
orderStore *core.OrderStore
|
activeMakerOrders *bbgo.ActiveOrderBook
|
||||||
position *types.Position
|
orderStore *core.OrderStore
|
||||||
tradeCollector *core.TradeCollector
|
position *types.Position
|
||||||
|
tradeCollector *core.TradeCollector
|
||||||
|
|
||||||
logger logrus.FieldLogger
|
logger logrus.FieldLogger
|
||||||
|
|
||||||
|
@ -353,6 +352,10 @@ func (e *FixedQuantityExecutor) updateOrder(ctx context.Context) error {
|
||||||
|
|
||||||
e.tradeCollector.Process()
|
e.tradeCollector.Process()
|
||||||
|
|
||||||
|
if e.delayInterval > 0 {
|
||||||
|
time.Sleep(e.delayInterval)
|
||||||
|
}
|
||||||
|
|
||||||
orderForm, err := e.generateOrder()
|
orderForm, err := e.generateOrder()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user