factorzoo

package
v1.31.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "factorzoo"

Variables

This section is empty.

Functions

func KLineAmplitudeMapper

func KLineAmplitudeMapper(k types.KLine) float64

Types

type Correlation

type Correlation struct {
	types.IntervalWindow
	Values  types.Float64Slice
	EndTime time.Time

	UpdateCallbacks []func(value float64)
}

func (*Correlation) Bind

func (inc *Correlation) Bind(updater indicator.KLineWindowUpdater)

func (*Correlation) EmitUpdate

func (inc *Correlation) EmitUpdate(value float64)

func (*Correlation) Last

func (inc *Correlation) Last() float64

func (*Correlation) OnUpdate

func (inc *Correlation) OnUpdate(cb func(value float64))

type IntervalWindowSetting

type IntervalWindowSetting struct {
	types.IntervalWindow
}

type KLineValueMapper

type KLineValueMapper func(k types.KLine) float64

type Strategy

type Strategy struct {
	Symbol   string `json:"symbol"`
	Market   types.Market
	Interval types.Interval   `json:"interval"`
	Quantity fixedpoint.Value `json:"quantity"`

	Position *types.Position `json:"position,omitempty"`

	Ret   []float64
	Alpha [][]float64

	T int64
	// contains filtered or unexported fields
}

func (*Strategy) ClosePosition

func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) Run

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

func (*Strategy) Subscribe

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

Jump to

Keyboard shortcuts

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