Documentation ¶
Index ¶
- func AddSlices(slice1, slice2 []float64) []float64
- func AddToAll(slice []float64, val float64) []float64
- func Avg(data []float64) float64
- func Bollinger(series []float64, mult int, period int) ([]float64, []float64, []float64)
- func CrossOver(value1, value2 []float64) bool
- func CrossUnder(value1, value2 []float64) bool
- func DivSlice(slice []float64, n float64) []float64
- func Donchian(high []float64, low []float64, period int) ([]float64, []float64, []float64)
- func EMA(series []float64, period int) []float64
- func Equal(value1, value2 float64) bool
- func ExponentialMovingAverage(series []float64, period int) []float64
- func Higher(value1, value2 float64) bool
- func Lower(value1, value2 float64) bool
- func MA(series []float64, period int) []float64
- func RMI(series []float64, fastRMIlength, fastMomentum, slowRMIlength, slowMomentum int) ([]float64, []float64)
- func RMIParallell(wg *sync.WaitGroup, series []float64) chan RMIData
- func ROC100(series []float64, period int) []float64
- func RateOfChange100(series []float64, period int) []float64
- func SMA(series []float64, period int) []float64
- func SimpleMovingAverage(series []float64, period int) []float64
- func StandardDeviation(series []float64, period int) float64
- func Std(slice []float64, period int) float64
- func SubSlices(slice1, slice2 []float64) []float64
- func Sum(data []float64) float64
- type ArrayOperator
- type Operator
- type RMIData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bollinger ¶
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 CrossUnder ¶
func Donchian ¶
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 ¶
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 ExponentialMovingAverage ¶
ExponentialMovingAverage is to start a new exponential moving average
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 RateOfChange100 ¶
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 SimpleMovingAverage ¶
SimpleMovingAverage to start a new moving average
func StandardDeviation ¶
Std returns standard deviation of a slice.