indicators

package
v0.0.0-...-0ea1e00 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSlices

func AddSlices(slice1, slice2 []float64) []float64

AddSlices adds two slices.

func AddToAll

func AddToAll(slice []float64, val float64) []float64

AddToAll adds a value to all slice elements.

func Avg

func Avg(data []float64) float64

Avg returns 'data' average.

func Bollinger

func Bollinger(series []float64, mult int, period int) ([]float64, []float64, []float64)

The Formula for Donchian Channels Is: UC = Highest High in Last N Periods Middle Channel=((UC−LC)/2) LC = Lowest Low in Last N periods where: UC = Upper channel N = Number of minutes, hours, days, weeks, months Period = Minutes, hours, days, weeks, months LC = Lower channel

func CrossOver

func CrossOver(value1, value2 []float64) bool

func CrossUnder

func CrossUnder(value1, value2 []float64) bool

func DivSlice

func DivSlice(slice []float64, n float64) []float64

DivSlice divides a slice by a float.

func Donchian

func Donchian(high []float64, low []float64, period int) ([]float64, []float64, []float64)

The Formula for Donchian Channels Is: UC = Highest High in Last N Periods Middle Channel=((UC−LC)/2) LC = Lowest Low in Last N periods where: UC = Upper channel N = Number of minutes, hours, days, weeks, months Period = Minutes, hours, days, weeks, months LC = Lower channel

func EMA

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

EMA is to start a new exponential moving average EMA = Price(t) * k + EMA(y) * (1 – k) t = today, y = yesterday, N = number of days in EMA, k = 2/(N+1)

func Equal

func Equal(value1, value2 float64) bool

func ExponentialMovingAverage

func ExponentialMovingAverage(series []float64, period int) []float64

ExponentialMovingAverage is to start a new exponential moving average

func Higher

func Higher(value1, value2 float64) bool

func Lower

func Lower(value1, value2 float64) bool

func MA

func MA(series []float64, period int) []float64

MA is the Moving Average, other alias are SMA or SimpleMovingAverage

func RMI

func RMI(series []float64, fastRMIlength, fastMomentum, slowRMIlength, slowMomentum int) ([]float64, []float64)

************************* CALCULATION ***************************** FastemaInc = ema(max(close - close[FastMomentum], 0), FastLenght) FastemaDec = ema(max(close[FastMomentum] - close, 0), FastLenght) FastRMI = FastemaDec == 0 ? 0 : 50 - 100 / (1 + FastemaInc / FastemaDec)

SlowemaInc = ema(max(close - close[SlowMomentum], 0), SlowLenght) SlowemaDec = ema(max(close[SlowMomentum] - close, 0), SlowLenght) SlowRMI = SlowemaDec == 0 ? 0 : 50 - 100 / (1 + SlowemaInc / SlowemaDec)

********************************************************************

func RMIParallell

func RMIParallell(wg *sync.WaitGroup, series []float64) chan RMIData

func ROC100

func ROC100(series []float64, period int) []float64

ROC100 is the Rate Of Change, other alias are RateOfChange

func RateOfChange100

func RateOfChange100(series []float64, period int) []float64

RateOfChange100 is used to get a value between 1 and 100 to pin point the rate of change ROC=(previous value / current value−1)∗100

func SMA

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

SMA is the Moving Average, other alias are MA or SimpleMovingAverage

func SimpleMovingAverage

func SimpleMovingAverage(series []float64, period int) []float64

SimpleMovingAverage to start a new moving average

func StandardDeviation

func StandardDeviation(series []float64, period int) float64

Std returns standard deviation of a slice.

func Std

func Std(slice []float64, period int) float64

func SubSlices

func SubSlices(slice1, slice2 []float64) []float64

SubSlices subtracts two slices.

func Sum

func Sum(data []float64) float64

Sum returns the sum of all elements of 'data'.

Types

type ArrayOperator

type ArrayOperator func(x, y []float64) bool

type Operator

type Operator func(x, y float64) bool

type RMIData

type RMIData struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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