indicators

package
v0.0.0-...-f2b55b7 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 1 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ATR

func ATR(inHigh, inLow, inClose []float64, inTimePeriod int) []float64

ATR returns the Average True Range for the given period

func BBANDS

func BBANDS(inReal []float64, inTimePeriod int, inNbDevUp, inNbDevDn float64, inMAType MaType) (upper, middle, lower []float64)

BBANDS returns the Bollinger Bands for the given period

func CorrelationCoefficient

func CorrelationCoefficient(c1, c2 []float64, period int) []float64

CorrelationCoefficient implements correlation coefficient

func EMA

func EMA(in []float64, period int) []float64

EMA returns the Exponential Moving Average for the given period

func MA

func MA(inReal []float64, inTimePeriod int, inMAType MaType) []float64

MA Moving Average helper

func MACD

func MACD(values []float64, fastPeriod, slowPeriod, signalPeriod int) (macdValues, signalPeriodValues, histogramValues []float64)

MACD returns the Moving Average Convergence Divergence indicator for the given fastPeriod, slowPeriod and signalPeriod

func MFI

func MFI(inHigh, inLow, inClose, inVolume []float64, inTimePeriod int) []float64

MFI returns Money Flow Index for the given period nolint gocyclo alternatives are to use reflection this is code increase v performance cost

func OBV

func OBV(closeIn, volIn []float64) []float64

OBV returns the On Balance Volume for the given period

func RSI

func RSI(inReal []float64, inTimePeriod int) []float64

RSI - Relative strength index

func SMA

func SMA(in []float64, period int) []float64

SMA returns the Simple Moving Average for the given period

Types

type MaType

type MaType uint

MaType Moving Average indicator types

const (
	Sma MaType = iota
	Ema
)

Moving Average indicator types

Jump to

Keyboard shortcuts

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