twap

package
v1.62.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 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 StreamExecutor

type StreamExecutor struct {
	Session        *bbgo.ExchangeSession
	Symbol         string
	Side           types.SideType
	TargetQuantity fixedpoint.Value
	SliceQuantity  fixedpoint.Value
	StopPrice      fixedpoint.Value
	NumOfTicks     int
	UpdateInterval time.Duration
	DeadlineTime   time.Time
	// contains filtered or unexported fields
}

StreamExecutor is a TWAP execution that places orders on the best price by connecting to the real time market data stream.

func (*StreamExecutor) Done

func (e *StreamExecutor) Done() (c <-chan struct{})

func (*StreamExecutor) Run

func (e *StreamExecutor) Run(parentCtx context.Context) error

func (*StreamExecutor) Shutdown

func (e *StreamExecutor) Shutdown(shutdownCtx context.Context)

Shutdown stops the execution If we call this method, it means the execution is still running, We need to: 1. stop the order updater (by using the execution context) 2. the order updater cancels all open orders and close the user data stream

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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