fastslowema

package
v0.0.0-...-e4b966e Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetOpenSignal

type GetOpenSignal func(ctx context.Context, series *timeseries.TimeSeries) (trengin.PositionType, error)

type Option

type Option func(*Strategy)

func WithAppName

func WithAppName(appName string) Option

func WithFlatMaxDiff

func WithFlatMaxDiff(diff float64) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithSmoothInterval

func WithSmoothInterval(fast, slow int) Option

func WithStopLoss

func WithStopLoss(indent float64) Option

type Strategy

type Strategy struct {
	// contains filtered or unexported fields
}

func NewStrategy

func NewStrategy(
	tinkoffToken,
	instrumentFIGI string,
	candleInterval investapi.CandleInterval,
	opts ...Option,
) (*Strategy, error)

func (*Strategy) Actions

func (f *Strategy) Actions() trengin.Actions

func (*Strategy) Errors

func (f *Strategy) Errors() <-chan error

func (*Strategy) Run

func (f *Strategy) Run(ctx context.Context)

type Trend

type Trend float64

func (Trend) IsDown

func (t Trend) IsDown() bool

func (Trend) IsFlat

func (t Trend) IsFlat() bool

func (Trend) IsUp

func (t Trend) IsUp() bool

Jump to

Keyboard shortcuts

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