bollmaker

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "bollmaker"

Variables

This section is empty.

Functions

This section is empty.

Types

type BollingerSetting

type BollingerSetting struct {
	types.IntervalWindow
	BandWidth float64 `json:"bandWidth"`
}

type State

type State struct {
	Position    *types.Position  `json:"position,omitempty"`
	ProfitStats bbgo.ProfitStats `json:"profitStats,omitempty"`
}

type Strategy

type Strategy struct {
	*bbgo.Graceful
	*bbgo.Notifiability
	*bbgo.Persistence

	StandardIndicatorSet *bbgo.StandardIndicatorSet

	Symbol          string           `json:"symbol"`
	Interval        types.Interval   `json:"interval"`
	Quantity        fixedpoint.Value `json:"quantity"`
	MinSpread       fixedpoint.Value `json:"minSpread"`
	Spread          fixedpoint.Value `json:"spread"`
	MinProfitSpread fixedpoint.Value `json:"minProfitSpread"`
	UseTickerPrice  bool             `json:"useTickerPrice"`

	// MaxExposurePosition is the maximum position you can hold
	// +10 means you can hold 10 ETH long position by maximum
	// -10 means you can hold -10 ETH short position by maximum
	MaxExposurePosition fixedpoint.Value `json:"maxExposurePosition"`

	// DisableShort means you can don't want short position during the market making
	DisableShort bool `json:"disableShort"`

	DefaultBollinger *BollingerSetting `json:"defaultBollinger"`
	NeutralBollinger *BollingerSetting `json:"neutralBollinger"`
	// contains filtered or unexported fields
}

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) LoadState

func (s *Strategy) LoadState() error

func (*Strategy) Run

func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error

func (*Strategy) SaveState

func (s *Strategy) SaveState() error

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