algo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

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

And compares if both condition algos are true.

func BiggerThan

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

BiggerThan compares the value of the two containing algos.

func BoolAlgo

func BoolAlgo(b bool) gbt.AlgoHandler

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

func CreateSignal

func CreateSignal(direction string) gbt.AlgoHandler

CreateSignal creates a signal with a specified direction.

func Equal

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

Equal compares the value of two algos.

func If

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

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

func IsInvested

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

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

func NotInvested

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

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

func Or

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

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

func RunDaily

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

RunDaily returns a RunDaily Algo ready to use.

func RunMonthly

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

RunMonthly return a RunMonthly Algo ready to use.

func RunOnce

func RunOnce() gbt.AlgoHandler

RunOnce returns a runOnce algo ready to use.

func RunQuarterly

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

RunQuarterly return a RunMonthly Algo ready to use.

func RunWeekly

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

RunWeekly return a RunDaily Algo ready to use.

func RunYearly

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

RunYearly return a RunMonthly Algo ready to use.

func SMA

func SMA(i int) gbt.AlgoHandler

SMA returns a sma algo ready to use.

func SmallerThan

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

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

func Xor

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

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

Types

type PeriodRunner

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

PeriodRunner defines how the function to compare two dates.

Jump to

Keyboard shortcuts

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