indicators

package
v1.0.31-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InTimePeriodValidator

func InTimePeriodValidator(period int, q *quota.Quota, c *quota.Candle) (*quota.Quota, bool)

InTimePeriodValidator will validate the quota length for the operator indicator.

Types

type AutoFibo

type AutoFibo struct {
	Tag       quota.IndicatorTag `mapstructure:"tag"`
	Ratios    []float64          `mapstructure:"ratios"`
	Deviation float64            `mapstructure:"deviation"`
	Depth     int                `mapstructure:"depth"`
}

AutoFibo is basically fibonacci series applied on the best spot to find some resistance/support lines.

func (*AutoFibo) Add

func (af *AutoFibo) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add AutoFibo into the candle or whole quota.

func (*AutoFibo) Is

func (af *AutoFibo) Is(tag quota.IndicatorTag) bool

Is determine provided tag belongs to this quota.Indicator or not.

type BollingerBandsB

type BollingerBandsB struct {
	Tag quota.IndicatorTag `mapstructure:"tag"`
	Std StandardDeviation  `mapstructure:"standardDeviation"`
}

BollingerBandsB is an advanced bollinger bands indicator.

func (*BollingerBandsB) Add

func (bbb *BollingerBandsB) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add BollingerBandsB into the candle or whole quota.

func (*BollingerBandsB) Is

func (bbb *BollingerBandsB) Is(tag quota.IndicatorTag) bool

Is determine provided tag belongs to this quota.Indicator or not.

type Hp

type Hp struct {
	Tag    quota.IndicatorTag `mapstructure:"tag"`
	Source quota.Source       `mapstructure:"source"`
	Lambda float64            `mapstructure:"lambda"`
	Length int                `mapstructure:"length"`
}

Hp filters the given source by Hodrick-Prescott filter.

func (*Hp) Add

func (hp *Hp) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add Hp into the candle or whole quota.

func (*Hp) Is

func (hp *Hp) Is(tag quota.IndicatorTag) bool

Is determine provided tag belongs to this quota.Indicator or not.

type LinearRegression

type LinearRegression struct {
	Tag          quota.IndicatorTag `mapstructure:"tag"`
	Source       quota.Source       `mapstructure:"source"`
	InTimePeriod int                `mapstructure:"period"`
}

LinearRegression is the lr indicator.

func (*LinearRegression) Add

func (lr *LinearRegression) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add LinearRegression into the candle or whole quota.

func (*LinearRegression) Is

Is determine provided tag belongs to this quota.Indicator or not.

type Ma

type Ma struct {
	Tag          quota.IndicatorTag `mapstructure:"tag"`
	Source       quota.Source       `mapstructure:"source"`
	Type         talib.MaType       `mapstructure:"type"`
	InTimePeriod int                `mapstructure:"period"`
}

Ma is a general wrapper for all talib.MaType supported by talib.

func (*Ma) Add

func (ma *Ma) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add Ma into the candle or whole quota.

func (*Ma) Is

func (ma *Ma) Is(tag quota.IndicatorTag) bool

Is determine provided tag belongs to this quota.Indicator or not.

type StandardDeviation

type StandardDeviation struct {
	Tag          quota.IndicatorTag `mapstructure:"tag"`
	Source       quota.Source       `mapstructure:"source"`
	InTimePeriod int                `mapstructure:"period"`
	Deviation    float64            `mapstructure:"deviation"`
}

StandardDeviation represents standard deviation indicator.

func (*StandardDeviation) Add

func (sd *StandardDeviation) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add StandardDeviation into the candle or whole quota.

func (*StandardDeviation) Is

Is determine provided tag belongs to this quota.Indicator or not.

type Stoch

type Stoch struct {
	Tag           quota.IndicatorTag `mapstructure:"tag"`
	KTag          quota.IndicatorTag `mapstructure:"kTag"`
	DTag          quota.IndicatorTag `mapstructure:"dTag"`
	InFastKPeriod int                `mapstructure:"kLength"`
	InSlowKPeriod int                `mapstructure:"kSmoothing"`
	InKMaType     talib.MaType       `mapstructure:"kMaType"`
	InSlowDPeriod int                `mapstructure:"dSmoothing"`
	InDMaType     talib.MaType       `mapstructure:"dMaType"`
}

Stoch is the stochastic indicator.

func (*Stoch) Add

func (s *Stoch) Add(q *quota.Quota, c *quota.Candle) bool

Add will calculate and add Stoch into the candle or whole quota.

func (*Stoch) Is

func (s *Stoch) Is(tag quota.IndicatorTag) bool

Is determine provided tag belongs to this quota.Indicator or not.

Jump to

Keyboard shortcuts

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