go_ehlers_indicators

package module
v0.0.0-...-fd6ced5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 9 Imported by: 0

README

Ehlers Indicators and Filters

A collection of John Ehlers technical analysis indicators and filters written in pure go Every indicator includes tests and a graph on synthetic data.

Installation:

go get github.com/MathisWellmann/go_ehlers_indicators

Indicators / Filters include:
Images:

With synthetic data from MathisWellmann/timeseries_generator

fama laguerre_filter frama super_smoother cyber_cycle center_of_gravity mama gaussian_filter re_flex trend_flex laguerre_rsi Roofing Filter fisher_transform inverse_fisher_transform

TODOs:
  • Swiss Army Knife Indicator
  • Ehlers Filter
  • (maybe) Empirical mode decomposition
  • (maybe) Fourier Transform for traders

Feel free to post a pull-request for more indicators or in case I made a mistake.

Documentation

Index

Constants

View Source
const (
	M = iota
	F
)

Variables

This section is empty.

Functions

func Alfa

func Alfa(length int) float64

func CenterOfGravity

func CenterOfGravity(vals []float64, windowLen int) []float64

CenterOfGravity Oscillator from this paper: https://mesasoftware.com/papers/TheCGOscillator.pdf

func CyberCycle

func CyberCycle(vals []float64, windowLen int) []float64

CyberCycle Indicator with alpha set to standard ema alpha: 2.0 / (windowLen + 1) from paper: https://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf

func CyberCycleAlpha

func CyberCycleAlpha(vals []float64, windowLen int, alpha float64) []float64

CyberCycle Indicator with custom alpha

func DIST4NCE

func DIST4NCE(vals []float64, length int) []float64

func EficiencyRatio

func EficiencyRatio(vals []float64, length int) []float64

func Extent

func Extent(vals []float64) (float64, float64)

Extent returns the min and max values of values

func FAMA

func FAMA(vals []float64, fastLimit, slowLimit float64) []float64

FAMA

func FAMADefault

func FAMADefault(vals []float64) []float64

FAMADefault is a wrapper for FAMA with recommended settings for fastLimit and slowLimit

func FRAMA

func FRAMA(highs, lows []float64, length int) ([]float64, error)

FRAMA (fractal adaptive moving average) from paper: http://mesasoftware.com/papers/FRAMA.pdf

func FisherTransform

func FisherTransform(vals []float64) ([]float64, error)

FisherTransform applies the fisher transform function to an array and outputs one with the same length Only accepts inputs in range (-1, 1) original pdf: https://www.mesasoftware.com/papers/UsingTheFisherTransform.pdf

func GaussianFilter

func GaussianFilter(vals []float64, period, numPoles int) []float64

GaussianFilter from this paper: https://www.mesasoftware.com/papers/GaussianFilters.pdf

func InverseFisherTransform

func InverseFisherTransform(vals []float64) []float64

InverseFisherTransform applies the Tanh function to all values in input series and returns an array of same length from this paper: http://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf

func Kama

func Kama(vals []float64, fast_period, slow_period, efficiency_length int) []float64

func KamaDefault

func KamaDefault(vals []float64) []float64

func LaguerreFilter

func LaguerreFilter(vals []float64, gamma float64) []float64

LaguerreFilter from paper: http://mesasoftware.com/papers/TimeWarp.pdf

func LaguerreFilterDefault

func LaguerreFilterDefault(vals []float64) []float64

func LaguerreRSI

func LaguerreRSI(vals []float64, gamma float64) []float64

LaguerreRSI from paper: http://mesasoftware.com/papers/TimeWarp.pdf

func LaguerreRSIDefault

func LaguerreRSIDefault(vals []float64) []float64

func MAMA

func MAMA(vals []float64, fastLimit, slowLimit float64) []float64

MAMA (MESA adaptive moving average)

func MAMADefault

func MAMADefault(vals []float64) []float64

MAMADefault provides a wrapper for MAMA with recommended fastsLimit of 0.5 and slowLimit of 0.05

func MAMAFAMA

func MAMAFAMA(vals []float64, fastLimit, slowLimit float64, which int) []float64

MAMA from this paper: https://www.mesasoftware.com/papers/MAMA.pdf

func MOM4

func MOM4(vals []float64) []float64

func Plt

func Plt(vals []float64, filename string) error

Plt will create a line plot with given values and filename

func ReFlex

func ReFlex(vals []float64, windowLen int) []float64

ReFlex indicator from: https://financial-hacker.com/petra-on-programming-a-new-zero-lag-indicator/

func RoofingFilter

func RoofingFilter(vals []float64) []float64

func SimpleKalman

func SimpleKalman(measurement []float64) []float64

func StDevRoll

func StDevRoll(vals []float64, length int) []float64

func TrendFlex

func TrendFlex(vals []float64, windowLen int) []float64

TrendFlex indicator from https://financial-hacker.com/petra-on-programming-a-new-zero-lag-indicator/

func Vidya

func Vidya(vals []float64, fast_period, slow_period int) []float64

func WMA4

func WMA4(vals []float64) []float64

y = (4*Price + 3*Price[1] + 2*Price[2] + Price[3]) / 10

func Wrt

func Wrt(vals, filter_out []float64, filename string) error

func Zema

func Zema(vals []float64, length_alfa, length_k, delay int) []float64

func ZeroLag

func ZeroLag(vals []float64, length, gainLimit int) []float64

ZeroLag filter from this paper: http://mesasoftware.com/papers/ZeroLag.pdf

func ZeroLagDefault

func ZeroLagDefault(vals []float64, length int) []float64

Types

type Values

type Values struct {
	Xs []float64
	Ys []float64
}

func (*Values) Len

func (v *Values) Len() int

func (*Values) XY

func (v *Values) XY(index int) (float64, float64)

Jump to

Keyboard shortcuts

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