backtest

package
v0.0.0-...-ab49fd9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const NewBacktestTopic = "strategy.NewBacktest"

Variables

This section is empty.

Functions

This section is empty.

Types

type AutomatedBacktest

type AutomatedBacktest struct {
	Storage *storage.Backtest `json:"storage"`
	// contains filtered or unexported fields
}

func (*AutomatedBacktest) Configure

func (e *AutomatedBacktest) Configure(ctx context.Context) error

Configure

func (*AutomatedBacktest) Load

func (e *AutomatedBacktest) Load(ctx context.Context, config *config.Config, instances ...*serviceStorage.Instance) error

func (*AutomatedBacktest) MarshalJSON

func (b *AutomatedBacktest) MarshalJSON() ([]byte, error)

func (*AutomatedBacktest) Run

func (e *AutomatedBacktest) Run(ctx context.Context) error

Run Runs configured workers and backtest until completed

func (*AutomatedBacktest) SetDependencies

func (e *AutomatedBacktest) SetDependencies(log *zap.Logger, periods storage.PeriodStorage, orders financeStorage.OrderStorage, positions financeStorage.PositionStorage)

func (*AutomatedBacktest) Stop

func (e *AutomatedBacktest) Stop(ctx context.Context) error

Stop Halts all workers and backtest

type AutomatedScheduler

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

func (*AutomatedScheduler) Start

func (a *AutomatedScheduler) Start()

func (*AutomatedScheduler) Stop

func (a *AutomatedScheduler) Stop()

type Backtest

type Backtest interface {
	SetDependencies(log *zap.Logger, periods storage.PeriodStorage, orders financeStorage.OrderStorage, positions financeStorage.PositionStorage)
	Load(ctx context.Context, config *config.Config, instances ...*serviceStorage.Instance) error
	Configure(context.Context) error
	Run(context.Context) error
	Stop(context.Context) error
}

type ManualBacktest

type ManualBacktest struct {
	Storage *storage.Backtest `json:"storage"`
	// contains filtered or unexported fields
}

func (*ManualBacktest) Configure

func (b *ManualBacktest) Configure(ctx context.Context) error

func (*ManualBacktest) Load

func (b *ManualBacktest) Load(ctx context.Context, config *config.Config, instances ...*serviceStorage.Instance) error

func (*ManualBacktest) MarshalJSON

func (b *ManualBacktest) MarshalJSON() ([]byte, error)

func (*ManualBacktest) Run

func (b *ManualBacktest) Run(ctx context.Context) error

func (*ManualBacktest) SetDependencies

func (e *ManualBacktest) SetDependencies(log *zap.Logger, periods storage.PeriodStorage, orders financeStorage.OrderStorage, positions financeStorage.PositionStorage)

func (*ManualBacktest) Stop

func (b *ManualBacktest) Stop(ctx context.Context) error

type NewBacktestPayload

type NewBacktestPayload struct {
	ID       string                 `json:"id"`
	Backtest serviceStorage.Service `json:"backtest"`
	Worker   serviceStorage.Service `json:"worker"`
}

type Scheduler

type Scheduler interface {
	Start()
	Stop()
}

func NewAutomatedScheduler

func NewAutomatedScheduler(config *config.Config, log *zap.Logger, stream stream.Stream, strategies storage.StrategyStorage, backtests storage.BacktestStorage, services serviceStorage.ServiceStorage) Scheduler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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