rebalance

package
v1.50.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "rebalance"

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneralOrderExecutorMap added in v1.44.0

type GeneralOrderExecutorMap map[string]*bbgo.GeneralOrderExecutor

func NewGeneralOrderExecutorMap added in v1.44.0

func NewGeneralOrderExecutorMap(session *bbgo.ExchangeSession, positionMap PositionMap) GeneralOrderExecutorMap

func (GeneralOrderExecutorMap) Bind added in v1.44.0

func (m GeneralOrderExecutorMap) Bind()

func (GeneralOrderExecutorMap) BindEnvironment added in v1.44.0

func (m GeneralOrderExecutorMap) BindEnvironment(environ *bbgo.Environment)

func (GeneralOrderExecutorMap) BindProfitStats added in v1.44.0

func (m GeneralOrderExecutorMap) BindProfitStats(profitStatsMap ProfitStatsMap)

func (GeneralOrderExecutorMap) GracefulCancel added in v1.44.0

func (m GeneralOrderExecutorMap) GracefulCancel(ctx context.Context) error

func (GeneralOrderExecutorMap) SubmitOrders added in v1.44.0

func (m GeneralOrderExecutorMap) SubmitOrders(ctx context.Context, submitOrders ...types.SubmitOrder) (types.OrderSlice, error)

func (GeneralOrderExecutorMap) Sync added in v1.44.0

func (m GeneralOrderExecutorMap) Sync(ctx context.Context, obj interface{})

type PositionMap added in v1.44.0

type PositionMap map[string]*types.Position

func (PositionMap) CreatePositions added in v1.45.0

func (m PositionMap) CreatePositions(markets []types.Market) PositionMap

type ProfitStatsMap added in v1.44.0

type ProfitStatsMap map[string]*types.ProfitStats

func (ProfitStatsMap) CreateProfitStats added in v1.45.0

func (m ProfitStatsMap) CreateProfitStats(markets []types.Market) ProfitStatsMap

type Strategy

type Strategy struct {
	Environment *bbgo.Environment

	Interval      types.Interval   `json:"interval"`
	QuoteCurrency string           `json:"quoteCurrency"`
	TargetWeights types.ValueMap   `json:"targetWeights"`
	Threshold     fixedpoint.Value `json:"threshold"`
	MaxAmount     fixedpoint.Value `json:"maxAmount"` // max amount to buy or sell per order
	OrderType     types.OrderType  `json:"orderType"`
	DryRun        bool             `json:"dryRun"`
	OnStart       bool             `json:"onStart"` // rebalance on start

	PositionMap    PositionMap    `persistence:"positionMap"`
	ProfitStatsMap ProfitStatsMap `persistence:"profitStatsMap"`
	// contains filtered or unexported fields
}

func (*Strategy) Defaults added in v1.44.0

func (s *Strategy) Defaults() error

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) Initialize added in v1.30.1

func (s *Strategy) Initialize() error

func (*Strategy) Run

func (*Strategy) Subscribe

func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)

func (*Strategy) Validate

func (s *Strategy) Validate() error

Jump to

Keyboard shortcuts

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