package gota
import "github.com/influxdata/influxdb/query/internal/gota"
Index ¶
- type AlgSimple
- type CMO
- func NewCMO(inTimePeriod int) *CMO
- func (cmo *CMO) Add(v float64) float64
- func (cmo *CMO) WarmCount() int
- func (cmo *CMO) Warmed() bool
- type CMOS
- func NewCMOS(inTimePeriod int, warmType WarmupType) *CMOS
- func (cmos *CMOS) Add(v float64) float64
- func (cmos CMOS) Last() float64
- func (cmos CMOS) WarmCount() int
- func (cmos CMOS) Warmed() bool
- type DEMA
- func NewDEMA(inTimePeriod int, warmType WarmupType) *DEMA
- func (dema *DEMA) Add(v float64) float64
- func (dema *DEMA) WarmCount() int
- func (dema *DEMA) Warmed() bool
- type EMA
- func NewEMA(inTimePeriod int, warmType WarmupType) *EMA
- func (ema *EMA) Add(v float64) float64
- func (ema *EMA) Last() float64
- func (ema *EMA) WarmCount() int
- func (ema *EMA) Warmed() bool
- type KAMA
- func NewKAMA(inTimePeriod int) *KAMA
- func (kama *KAMA) Add(v float64) float64
- func (kama *KAMA) WarmCount() int
- func (kama *KAMA) Warmed() bool
- type KER
- func NewKER(inTimePeriod int) *KER
- func (ker *KER) Add(v float64) float64
- func (ker *KER) WarmCount() int
- func (ker *KER) Warmed() bool
- type RSI
- func NewRSI(inTimePeriod int, warmType WarmupType) *RSI
- func (rsi *RSI) Add(v float64) float64
- func (rsi RSI) Last() float64
- func (rsi RSI) WarmCount() int
- func (rsi RSI) Warmed() bool
- type TEMA
- func NewTEMA(inTimePeriod int, warmType WarmupType) *TEMA
- func (tema *TEMA) Add(v float64) float64
- func (tema *TEMA) WarmCount() int
- func (tema *TEMA) Warmed() bool
- type TRIX
- func NewTRIX(inTimePeriod int, warmType WarmupType) *TRIX
- func (trix *TRIX) Add(v float64) float64
- func (trix *TRIX) WarmCount() int
- func (trix *TRIX) Warmed() bool
- type WarmupType
Types ¶
type AlgSimple ¶
type CMO ¶
type CMO struct {
// contains filtered or unexported fields
}
CMO - Chande Momentum Oscillator (https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/cmo)
func NewCMO ¶
NewCMO constructs a new CMO.
func (*CMO) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*CMO) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*CMO) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type CMOS ¶
type CMOS struct {
// contains filtered or unexported fields
}
CMOS is a smoothed version of the Chande Momentum Oscillator. This is the version of CMO utilized by ta-lib.
func NewCMOS ¶
func NewCMOS(inTimePeriod int, warmType WarmupType) *CMOS
NewCMOS constructs a new CMOS.
func (*CMOS) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (CMOS) Last ¶
Last returns the last output value.
func (CMOS) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (CMOS) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type DEMA ¶
type DEMA struct {
// contains filtered or unexported fields
}
DEMA - Double Exponential Moving Average (https://en.wikipedia.org/wiki/Double_exponential_moving_average)
func NewDEMA ¶
func NewDEMA(inTimePeriod int, warmType WarmupType) *DEMA
NewDEMA constructs a new DEMA.
When warmed with WarmSMA the first inTimePeriod samples will result in a simple average, switching to exponential moving average after warmup is complete.
When warmed with WarmEMA the algorithm immediately starts using an exponential moving average for the output values. During the warmup period the alpha value is scaled to prevent unbalanced weighting on initial values.
func (*DEMA) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*DEMA) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*DEMA) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type EMA ¶
type EMA struct {
// contains filtered or unexported fields
}
EMA - Exponential Moving Average (http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_averages#exponential_moving_average_calculation)
func NewEMA ¶
func NewEMA(inTimePeriod int, warmType WarmupType) *EMA
NewEMA constructs a new EMA.
When warmed with WarmSMA the first inTimePeriod samples will result in a simple average, switching to exponential moving average after warmup is complete.
When warmed with WarmEMA the algorithm immediately starts using an exponential moving average for the output values. During the warmup period the alpha value is scaled to prevent unbalanced weighting on initial values.
func (*EMA) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*EMA) Last ¶
Last returns the last output value.
func (*EMA) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*EMA) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type KAMA ¶
type KAMA struct {
// contains filtered or unexported fields
}
KAMA - Kaufman's Adaptive Moving Average (http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:kaufman_s_adaptive_moving_average)
func NewKAMA ¶
NewKAMA constructs a new KAMA.
func (*KAMA) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*KAMA) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*KAMA) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type KER ¶
type KER struct {
// contains filtered or unexported fields
}
KER - Kaufman's Efficiency Ratio (http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:kaufman_s_adaptive_moving_average#efficiency_ratio_er)
func NewKER ¶
NewKER constructs a new KER.
func (*KER) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*KER) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*KER) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type RSI ¶
type RSI struct {
// contains filtered or unexported fields
}
RSI - Relative Strength Index (http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:relative_strength_index_rsi)
func NewRSI ¶
func NewRSI(inTimePeriod int, warmType WarmupType) *RSI
NewRSI constructs a new RSI.
func (*RSI) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (RSI) Last ¶
Last returns the last output value.
func (RSI) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (RSI) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type TEMA ¶
type TEMA struct {
// contains filtered or unexported fields
}
TEMA - Triple Exponential Moving Average (https://en.wikipedia.org/wiki/Triple_exponential_moving_average)
func NewTEMA ¶
func NewTEMA(inTimePeriod int, warmType WarmupType) *TEMA
NewTEMA constructs a new TEMA.
When warmed with WarmSMA the first inTimePeriod samples will result in a simple average, switching to exponential moving average after warmup is complete.
When warmed with WarmEMA the algorithm immediately starts using an exponential moving average for the output values. During the warmup period the alpha value is scaled to prevent unbalanced weighting on initial values.
func (*TEMA) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*TEMA) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*TEMA) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type TRIX ¶
type TRIX struct {
// contains filtered or unexported fields
}
Trix - TRIple Exponential average (http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:trix)
func NewTRIX ¶
func NewTRIX(inTimePeriod int, warmType WarmupType) *TRIX
NewTRIX constructs a new TRIX.
func (*TRIX) Add ¶
Add adds a new sample value to the algorithm and returns the computed value.
func (*TRIX) WarmCount ¶
WarmCount returns the number of samples that must be provided for the algorithm to be fully "warmed".
func (*TRIX) Warmed ¶
Warmed indicates whether the algorithm has enough data to generate accurate results.
type WarmupType ¶
type WarmupType int8
const ( WarmEMA WarmupType = iota // Exponential Moving Average WarmSMA // Simple Moving Average )
func ParseWarmupType ¶
func ParseWarmupType(wt string) (WarmupType, error)
Source Files ¶
cmo.go ema.go kama.go rsi.go trix.go
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 2 days ago –
Tools for package owners.