backtestconfig

package
v0.3.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annually

func Annually() func(t time.Time, _ []float64) bool

func Daily

func Daily() func(t time.Time, _ []float64) bool

func Monthly

func Monthly() func(t time.Time, currentWeights []float64) bool

func Never

func Never() func(t time.Time, currentWeights []float64) bool

func Quarterly

func Quarterly() func(t time.Time, _ []float64) bool

func TruncateWithLookBack

func TruncateWithLookBack(end, start time.Time, dur Window, returns returns.List) returns.List

func Weekly

func Weekly() func(t time.Time, _ []float64) bool

Types

type Interval

type Interval string
const (
	IntervalDefault            = IntervalNever
	IntervalNever     Interval = "Never"
	IntervalDaily     Interval = "Daily"
	IntervalWeekly    Interval = "Weekly"
	IntervalMonthly   Interval = "Monthly"
	IntervalQuarterly Interval = "Quarterly"
	IntervalAnnually  Interval = "Annually"
)

func Intervals

func Intervals() []Interval

func (Interval) CheckFunction

func (t Interval) CheckFunction() func(t time.Time, currentWeights []float64) bool

func (Interval) Options added in v0.2.0

func (t Interval) Options() []Interval

func (Interval) String

func (t Interval) String() string

func (Interval) Validate

func (t Interval) Validate() error

type IntervalCheckFunc

type IntervalCheckFunc func(t time.Time) bool

type Window

type Window string
const (
	WindowNotSet     Window = ""
	OneDayWindow     Window = "1 Day"
	OneWeekWindow    Window = "1 Week"
	OneMonthWindow   Window = "1 Month"
	OneQuarterWindow Window = "1 Quarter"
	OneYearWindow    Window = "1 Year"
	ThreeYearWindow  Window = "3 Years"
	FiveYearWindow   Window = "5 Years"
)

func Windows

func Windows() []Window

func (Window) Add

func (dur Window) Add(t time.Time) time.Time

func (Window) Function

func (dur Window) Function(today time.Time, table returns.Table) returns.Table

func (Window) IsSet

func (dur Window) IsSet() bool

func (Window) Options added in v0.2.0

func (dur Window) Options() []Window

func (Window) String

func (dur Window) String() string

func (Window) Sub

func (dur Window) Sub(t time.Time) time.Time

func (Window) Validate

func (dur Window) Validate() error

Jump to

Keyboard shortcuts

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