twap

package
v1.61.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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 (*FixedQuantityExecutor) WaitForConnection

func (e *FixedQuantityExecutor) WaitForConnection(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL