Documentation ¶
Index ¶
- type DoneSignal
- type FixedQuantityExecutor
- func (e *FixedQuantityExecutor) Done() <-chan struct{}
- func (e *FixedQuantityExecutor) SetDeadlineTime(t time.Time)
- func (e *FixedQuantityExecutor) SetDelayInterval(delayInterval time.Duration)
- func (e *FixedQuantityExecutor) SetNumOfTicks(numOfTicks int)
- func (e *FixedQuantityExecutor) SetOrderUpdateRateLimit(rateLimit *rate.Limiter)
- func (e *FixedQuantityExecutor) SetStopPrice(price fixedpoint.Value)
- func (e *FixedQuantityExecutor) SetUpdateInterval(updateInterval time.Duration)
- func (e *FixedQuantityExecutor) Shutdown(shutdownCtx context.Context)
- func (e *FixedQuantityExecutor) Start(ctx context.Context) error
- func (e *FixedQuantityExecutor) WaitForConnection(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoneSignal ¶
type DoneSignal struct {
// contains filtered or unexported fields
}
func NewDoneSignal ¶
func NewDoneSignal() *DoneSignal
func (*DoneSignal) Chan ¶
func (e *DoneSignal) Chan() (c <-chan struct{})
Chan returns a channel that emits a signal when the execution is done.
func (*DoneSignal) Emit ¶
func (e *DoneSignal) Emit()
type FixedQuantityExecutor ¶
type FixedQuantityExecutor struct {
// contains filtered or unexported fields
}
FixedQuantityExecutor is a TWAP executor that places orders on the exchange using the exchange's stream API. It uses a fixed target quantity to place orders.
func NewFixedQuantityExecutor ¶ added in v1.60.1
func NewFixedQuantityExecutor( exchange types.Exchange, symbol string, market types.Market, side types.SideType, targetQuantity, sliceQuantity fixedpoint.Value, ) *FixedQuantityExecutor
func (*FixedQuantityExecutor) Done ¶
func (e *FixedQuantityExecutor) Done() <-chan struct{}
Done returns a channel that emits a signal when the execution is done.
func (*FixedQuantityExecutor) SetDeadlineTime ¶
func (e *FixedQuantityExecutor) SetDeadlineTime(t time.Time)
func (*FixedQuantityExecutor) SetDelayInterval ¶
func (e *FixedQuantityExecutor) SetDelayInterval(delayInterval time.Duration)
func (*FixedQuantityExecutor) SetNumOfTicks ¶ added in v1.60.1
func (e *FixedQuantityExecutor) SetNumOfTicks(numOfTicks int)
func (*FixedQuantityExecutor) SetOrderUpdateRateLimit ¶ added in v1.60.1
func (e *FixedQuantityExecutor) SetOrderUpdateRateLimit(rateLimit *rate.Limiter)
func (*FixedQuantityExecutor) SetStopPrice ¶ added in v1.60.1
func (e *FixedQuantityExecutor) SetStopPrice(price fixedpoint.Value)
func (*FixedQuantityExecutor) SetUpdateInterval ¶
func (e *FixedQuantityExecutor) SetUpdateInterval(updateInterval time.Duration)
func (*FixedQuantityExecutor) Shutdown ¶
func (e *FixedQuantityExecutor) Shutdown(shutdownCtx context.Context)
Shutdown stops the execution If we call this method, it means the execution is still running, We need it to: 1. Stop the order updater (by using the execution context) 2. The order updater cancels all open orders and closes the user data stream
func (*FixedQuantityExecutor) Start ¶
func (e *FixedQuantityExecutor) Start(ctx context.Context) error
func (*FixedQuantityExecutor) WaitForConnection ¶
func (e *FixedQuantityExecutor) WaitForConnection(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.