gobacktest: github.com/dirkolbrich/gobacktest/algo Index | Files

package algo

import "github.com/dirkolbrich/gobacktest/algo"

Index

Package Files

base.go comparison.go conditional.go indicator.go period.go portfolio.go signal.go

func And Uses

func And(a, b gbt.AlgoHandler) gbt.AlgoHandler

And compares if both condition algos are true.

func BiggerThan Uses

func BiggerThan(first, second gbt.AlgoHandler) gbt.AlgoHandler

BiggerThan compares the value of the two containing algos.

func BoolAlgo Uses

func BoolAlgo(b bool) gbt.AlgoHandler

BoolAlgo returns a simple true/false algo ready to use.

func CreateSignal Uses

func CreateSignal(direction string) gbt.AlgoHandler

CreateSignal creates a signal with a specified direction.

func Equal Uses

func Equal(first, second gbt.AlgoHandler) gbt.AlgoHandler

Equal compares the value of two algos.

func If Uses

func If(condition, action gbt.AlgoHandler) gbt.AlgoHandler

If triggers an action algo if a condition algo is true.

func IsInvested Uses

func IsInvested(symbols ...string) gbt.AlgoHandler

IsInvested check if the portfolio hols a position for the given symbol.

func NotInvested Uses

func NotInvested(symbols ...string) gbt.AlgoHandler

NotInvested check if the portfolio holds no position for the given symbol.

func Or Uses

func Or(a, b gbt.AlgoHandler) gbt.AlgoHandler

Or compares if any or both of two algos are true.

func RunDaily Uses

func RunDaily(opt ...string) gbt.AlgoHandler

RunDaily returns a RunDaily Algo ready to use.

func RunMonthly Uses

func RunMonthly(opt ...string) gbt.AlgoHandler

RunMonthly return a RunMonthly Algo ready to use.

func RunOnce Uses

func RunOnce() gbt.AlgoHandler

RunOnce returns a runOnce algo ready to use.

func RunQuarterly Uses

func RunQuarterly(opt ...string) gbt.AlgoHandler

RunQuarterly return a RunMonthly Algo ready to use.

func RunWeekly Uses

func RunWeekly(opt ...string) gbt.AlgoHandler

RunWeekly return a RunDaily Algo ready to use.

func RunYearly Uses

func RunYearly(opt ...string) gbt.AlgoHandler

RunYearly return a RunMonthly Algo ready to use.

func SMA Uses

func SMA(i int) gbt.AlgoHandler

SMA returns a sma algo ready to use.

func SmallerThan Uses

func SmallerThan(first, second gbt.AlgoHandler) gbt.AlgoHandler

SmallerThan compares if the value of the first algo is smaller than second.

func Xor Uses

func Xor(a, b gbt.AlgoHandler) gbt.AlgoHandler

Xor compares if any one but only one of two algos is true.

type PeriodRunner Uses

type PeriodRunner interface {
    CompareDates(time.Time, time.Time) (bool, error)
}

PeriodRunner defines how the function to compare two dates.

Package algo imports 4 packages (graph) and is imported by 4 packages. Updated 2019-12-06. Refresh now. Tools for package owners.