fta

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 1 Imported by: 1

README

FTA

Go Report Card Go Reference

Financial technical indicators implemented in Go.

Port of Python library peerchemist/finta

Implemented indicators

  • SMA (Simple moving average)
  • SMM (Simple moving median)
  • SSMA (Smoothed simple moving average)
  • EMA (Exponential Weighted Moving Average)
  • ROC (The Rate-of-Change)
  • KST (Know Sure Thing)
  • FISH (Fisher Transform)
  • MACD (Moving Average Convergence Divergence)
  • BBANDS (Bollinger Bands)
  • PercentB (Percent B)
  • RSI (Relative Strength Index)
  • CRSI (Connors RSI)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BBANDS

func BBANDS(column series.Data, ma series.Data, period int, stdMultiplier float64) (upper, lower series.Data)

Developed by John Bollinger, Bollinger Bands® are volatility bands placed above and below a moving average. Volatility is based on the standard deviation, which changes as volatility increases and decreases. The bands automatically widen when volatility increases and narrow when volatility decreases.

func CRSI

func CRSI(close series.Data, period int, periodUpDown int, periodrRoc int, adjust bool) (crsi series.Data)

Connors RSI (CRSI) is a technical analysis indicator created by Larry Connors that is actually a composite of three separate components. The Relative Strength Index (RSI), developed by J. Welles Wilder, plays an integral role in Connors RSI. Connors RSI outputs a value between 0 and 100, which is then used to identify short-term overbought and oversold conditions.

func EMA added in v0.1.2

func EMA(column series.Data, period int, adjust bool) (ema series.Data)

Exponential Weighted Moving Average - Like all moving average indicators, they are much better suited for trending markets. When the market is in a strong and sustained uptrend, the EMA indicator line will also show an uptrend and vice-versa for a down trend. EMAs are commonly used in conjunction with other indicators to confirm significant market moves and to gauge their validity.

func FISH

func FISH(low, high series.Data, period int, adjust bool) (fish series.Data)

Fisher Transform was presented by John Ehlers. It assumes that price distributions behave like square waves.

func KST

func KST(column series.Data, r1, r2, r3, r4 int) (k, signal series.Data)

Know Sure Thing (KST) is a momentum oscillator based on the smoothed rate-of-change for four different time frames. KST measures price momentum for four different price cycles. It can be used just like any momentum oscillator. Chartists can look for divergences, overbought/oversold readings, signal line crossovers and centerline crossovers.

func MACD

func MACD(column series.Data, periodFast float64, periodSlow float64, signal float64, adjust bool) (macd, macdSignal series.Data)

MACD, MACD Signal and MACD difference. The MACD Line oscillates above and below the zero line, which is also known as the centerline. These crossovers signal that the 12-day EMA has crossed the 26-day EMA. The direction, of course, depends on the direction of the moving average cross. Positive MACD indicates that the 12-day EMA is above the 26-day EMA. Positive values increase as the shorter EMA diverges further from the longer EMA. This means upside momentum is increasing. Negative MACD values indicates that the 12-day EMA is below the 26-day EMA.

Negative values increase as the shorter EMA diverges further below the longer EMA. This means downside momentum is increasing. Signal line crossovers are the most common MACD signals. The signal line is a 9-day EMA of the MACD Line. As a moving average of the indicator, it trails the MACD and makes it easier to spot MACD turns. A bullish crossover occurs when the MACD turns up and crosses above the signal line. A bearish crossover occurs when the MACD turns down and crosses below the signal line.

func PercentB

func PercentB(column series.Data, ma series.Data, period int, stdMultiplier float64) (percentB series.Data)

%b (pronounced 'percent b') is derived from the formula for Stochastics and shows where price is in relation to the bands. %b equals 1 at the upper band and 0 at the lower band.

func ROC

func ROC(column series.Data, period int) (roc series.Data)

The Rate-of-Change (ROC) indicator, which is also referred to as simply Momentum, is a pure momentum oscillator that measures the percent change in price from one period to the next. The ROC calculation compares the current price with the price “n” periods ago.

func RSI

func RSI(column series.Data, period int, adjust bool) (rsi series.Data)

Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. RSI oscillates between zero and 100. Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30. Signals can also be generated by looking for divergences, failure swings and centerline crossovers. RSI can also be used to identify the general trend.

func SMA

func SMA(column series.Data, period int) (sma series.Data)

Simple moving average - rolling mean in pandas lingo. Also known as 'MA'. The simple moving average (SMA) is the most basic of the moving averages used for trading.

func SMM added in v0.1.2

func SMM(column series.Data, period int) (smm series.Data)

Simple moving median, an alternative to moving average. SMA, when used to estimate the underlying trend in a time series, is susceptible to rare events such as rapid shocks or other anomalies. A more robust estimate of the trend is the simple moving median over n time periods.

func SSMA added in v0.1.2

func SSMA(column series.Data, period int, adjust bool) (ssma series.Data)

Smoothed simple moving average.

Types

type DType added in v0.1.1

type DType = series.DType

Jump to

Keyboard shortcuts

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