# README
go-talib
https://pkg.go.dev/github.com/markcheno/go-talib
Install
Install the package with:
go get github.com/markcheno/go-talib
Import it with:
import "github.com/markcheno/go-talib"
and use talib
as the package name inside the code.
Example
package main
import (
"fmt"
"github.com/markcheno/go-quote"
"github.com/markcheno/go-talib"
)
func main() {
spy, _ := quote.NewQuoteFromYahoo("spy", "2016-01-01", "2016-04-01", quote.Daily, true)
fmt.Print(spy.CSV())
rsi2 := talib.Rsi(spy.Close, 2)
fmt.Println(rsi2)
}
License
MIT License - see LICENSE for more details
Contributors
# Functions
Acos - Vector Trigonometric ACOS.
Ad - Chaikin A/D Line.
Add - Vector arithmetic addition.
AdOsc - Chaikin A/D Oscillator.
Adx - Average Directional Movement Index.
AdxR - Average Directional Movement Index Rating.
Apo - Absolute Price Oscillator.
Aroon - Aroon aroondown, aroonup = AROON(high, low, timeperiod=14).
AroonOsc - Aroon Oscillator.
Asin - Vector Trigonometric ASIN.
Atan - Vector Trigonometric ATAN.
Atr - Average True Range.
AvgPrice - Average Price (o+h+l+c)/4.
BBands - Bollinger Bands upperband, middleband, lowerband = BBands(close, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0).
Beta - Beta.
Bop - Balance Of Power.
Cci - Commodity Channel Index.
Ceil - Vector CEIL.
Cmo - Chande Momentum Oscillator.
Correl - Pearson's Correlation Coefficient (r).
Cos - Vector Trigonometric COS.
Cosh - Vector Trigonometric COSH.
Crossover returns true if series1 is crossing over series2.
Crossunder returns true if series1 is crossing under series2.
Dema - Double Exponential Moving Average.
Div - Vector arithmetic division.
Dx - Directional Movement Index.
Ema - Exponential Moving Average.
Exp - Vector atrithmetic EXP.
Floor - Vector FLOOR.
GroupCandles groups a set of candles in another set of candles, basing on a grouping factor.
HeikinashiCandles - from candle values extracts heikinashi candle values.
Hlc3 returns the Hlc3 values
NOTE: Every Hlc item is defined as follows : (high + low + close) / 3 It is used as AvgPrice candle.
HtDcPeriod - Hilbert Transform - Dominant Cycle Period (lookback=32).
HtDcPhase - Hilbert Transform - Dominant Cycle Phase (lookback=63).
HtPhasor - Hibert Transform - Phasor Components (lookback=32).
HtSine - Hilbert Transform - SineWave (lookback=63).
HtTrendline - Hilbert Transform - Instantaneous Trendline (lookback=63).
HtTrendMode - Hilbert Transform - Trend vs Cycle Mode (lookback=63).
Kama - Kaufman Adaptive Moving Average.
LinearReg - Linear Regression.
LinearRegAngle - Linear Regression Angle.
LinearRegIntercept - Linear Regression Intercept.
LinearRegSlope - Linear Regression Slope.
Ln - Vector natural log LN.
Log10 - Vector LOG10.
Ma - Moving average.
Macd - Moving Average Convergence/Divergence unstable period ~= 100.
MacdExt - MACD with controllable MA type unstable period ~= 100.
MacdFix - MACD Fix 12/26 unstable period ~= 100.
Mama - MESA Adaptive Moving Average (lookback=32).
MaVp - Moving average with variable period.
Max - Highest value over a period.
MaxIndex - Index of highest value over a specified period.
MedPrice - Median Price (h+l)/2.
Mfi - Money Flow Index.
MidPoint - MidPoint over period.
MidPrice - Midpoint Price over period.
Min - Lowest value over a period.
MinIndex - Index of lowest value over a specified period.
MinMax - Lowest and highest values over a specified period.
MinMaxIndex - Indexes of lowest and highest values over a specified period.
MinusDI - Minus Directional Indicator.
MinusDM - Minus Directional Movement.
Mom - Momentum.
Mult - Vector arithmetic multiply.
Natr - Normalized Average True Range.
Obv - On Balance Volume.
PlusDI - Plus Directional Indicator.
PlusDM - Plus Directional Movement.
Ppo - Percentage Price Oscillator.
Roc - Rate of change : ((price/prevPrice)-1)*100.
Rocp - Rate of change Percentage: (price-prevPrice)/prevPrice.
Rocr - Rate of change ratio: (price/prevPrice).
Rocr100 - Rate of change ratio 100 scale: (price/prevPrice)*100.
Rsi - Relative strength index.
Sar - Parabolic SAR real = Sar(high, low, acceleration=0, maximum=0).
SarExt - Parabolic SAR - Extended real = SAREXT(high, low, startvalue=0, offsetonreverse=0, accelerationinitlong=0, accelerationlong=0, accelerationmaxlong=0, accelerationinitshort=0, accelerationshort=0, accelerationmaxshort=0).
Sin - Vector Trigonometric SIN.
Sinh - Vector Trigonometric SINH.
Sma - Simple Moving Average.
Sqrt - Vector SQRT.
StdDev - Standard Deviation.
Stoch - Stochastic.
StochF - Stochastic Fast.
StochRsi - Stochastic Relative Strength Index.
Sub - Vector arithmetic subtraction.
Sum - Vector summation.
T3 - Triple Exponential Moving Average (T3) (lookback=6*inTimePeriod).
Tan - Vector Trigonometric TAN.
Tanh - Vector Trigonometric TANH.
Tema - Triple Exponential Moving Average.
TRange - True Range.
Trima - Triangular Moving Average.
Trix - 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA.
Tsf - Time Series Forecast.
TypPrice - Typical Price (h+l+c)/3.
UltOsc - Ultimate Oscillator.
Var - Variance.
WclPrice - Weighted Close Price.
WillR - Williams' %R.
Wma - Weighted Moving Average.
# Type aliases
MaType - Moving average type.