optimizer

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TotalProfitMetricValueFunc = func(summaryReport *backtest.SummaryReport) fixedpoint.Value {
	return summaryReport.TotalProfit
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Matrix []SelectorConfig `yaml:"matrix"`
}

func LoadConfig

func LoadConfig(yamlConfigFileName string) (*Config, error)

type Executor

type Executor interface {
	Execute(configJson []byte) (*backtest.SummaryReport, error)
}

type GridOptimizer

type GridOptimizer struct {
	Config *Config

	ParamLabels   []string
	CurrentParams []interface{}
}

func (*GridOptimizer) Run

func (o *GridOptimizer) Run(executor Executor, configJson []byte) ([]Metric, error)

type LocalProcessExecutor

type LocalProcessExecutor struct {
	Bin       string
	WorkDir   string
	ConfigDir string
	OutputDir string
}

func (*LocalProcessExecutor) Execute

func (e *LocalProcessExecutor) Execute(configJson []byte) (*backtest.SummaryReport, error)

type Metric

type Metric struct {
	Labels []string         `json:"labels,omitempty"`
	Params []interface{}    `json:"params,omitempty"`
	Value  fixedpoint.Value `json:"value,omitempty"`
}

type MetricValueFunc

type MetricValueFunc func(summaryReport *backtest.SummaryReport) fixedpoint.Value

type OpFunc

type OpFunc func(configJson []byte, next func(configJson []byte) error) error

type SelectorConfig

type SelectorConfig struct {
	Type   string           `json:"type" yaml:"type"`
	Label  string           `json:"label,omitempty" yaml:"label,omitempty"`
	Path   string           `json:"path" yaml:"path"`
	Values []string         `json:"values,omitempty" yaml:"values,omitempty"`
	Min    fixedpoint.Value `json:"min,omitempty" yaml:"min,omitempty"`
	Max    fixedpoint.Value `json:"max,omitempty" yaml:"max,omitempty"`
	Step   fixedpoint.Value `json:"step,omitempty" yaml:"step,omitempty"`
}

Jump to

Keyboard shortcuts

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