indicators

package
v0.0.0-...-08b7c41 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

	import "github.com/thetruetrade/gotrade"

	Package indicators provides a range of technical trading indicators.
	All indicators follow the basic structure of:
		- receiving price data,	processing this price data and storing the transformed result.
		- maximum and minimum bounds of the transformed results are calculated automatically.
		- a lookback period indicating the lag between source data and the transformed result.
		- the source data bar from which the indicator is valid

 	Functions are provided for each indicator that provide indicator creation
 	for the following scenarios:

 	Online Usage
		- the data stream length is not known ahead of time, e.g. real time data streams
 	Offline Usage
		- the data stream length is known ahead of time, e.g. historical data streams

	Both scenarios provide the following indicator creation functions
 		* Indicator with default parameters
 		* Indicator with default parameters for attachment to a data stream
 		* Indicator with specified parameters
 		* Indicator with specified parameters for attachment to a data stream
 		* Indicator without storage with specified parameters
			- for use inside other indicators, has no storage of results which is instead
			- provided via a callback when it becomes available for use in the parent indicator.

Moving Average Convergence and Divergence (Macd)

Simple Moving Average (Sma)

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSourceDataEmpty                      = errors.New("Source data is empty")
	ErrNotEnoughSourceDataForLookbackPeriod = errors.New("Source data does not contain enough data for the specfied lookback period")
	ErrLookbackPeriodMustBeGreaterThanZero  = errors.New("Lookback period must be greater than 0")
	ErrValueAvailableActionIsNil            = errors.New("A ValueAvailableAction is required")
	ErrDOHLCVDataSelectFuncIsNil            = errors.New("A DOHLCVDataSelectionFunc is required")
	ErrStrBelowMinimum                      = "is less than the minimum"
	ErrStrAboveMaximum                      = "is greater than the maximum"

	// lookback minimum
	MinimumLookbackPeriod int = 0
	// lookback maximum
	MaximumLookbackPeriod int = 100000
)

Functions

This section is empty.

Types

type Adl

type Adl struct {
	*AdlWithoutStorage

	// public variables
	Data []float64
}

An Accumulation Distribution Line Indicator (Adl)

func NewAdl

func NewAdl() (indicator *Adl, err error)

NewAdl creates an Accumulation Distribution Line Indicator (Adl) for online usage

func NewAdlForStream

func NewAdlForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adl, err error)

NewAdlForStream creates an Accumulation Distribution Line Indicator (Adl) for online usage with a source data stream

func NewAdlForStreamWithSrcLen

func NewAdlForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adl, err error)

NewAdlForStreamWithSrcLen creates an Accumulation Distribution Line Indicator (Adl) for offline usage with a source data stream

func NewAdlWithSrcLen

func NewAdlWithSrcLen(sourceLength uint) (indicator *Adl, err error)

NewAdlWithSrcLen creates an Accumulation Distribution Line Indicator (Adl) for offline usage

func (Adl) UpdateIndicatorWithNewValue

func (ind Adl) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AdlWithoutStorage

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

An Accumulation Distribution Line Indicator (Adl), no storage, for use in other indicators

func NewAdlWithoutStorage

func NewAdlWithoutStorage(valueAvailableAction ValueAvailableActionFloat) (indicator *AdlWithoutStorage, err error)

NewAdlWithoutStorage creates an Accumulation Distribution Line Indicator (Adl) without storage

func (*AdlWithoutStorage) ReceiveDOHLCVTick

func (ind *AdlWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AdlWithoutStorage) UpdateIndicatorWithNewValue

func (ind AdlWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Adx

type Adx struct {
	*AdxWithoutStorage

	// public variables
	Data []float64
}

A Directional Movement Indicator (Adx)

func NewAdx

func NewAdx(timePeriod int) (indicator *Adx, err error)

NewAdx creates an Average Directional Index (Adx) for online usage

func NewAdxForStream

func NewAdxForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Adx, err error)

NewAdxForStream creates an Average Directional Index (Adx) for online usage with a source data stream

func NewAdxForStreamWithSrcLen

func NewAdxForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Adx, err error)

NewAdxForStreamWithSrcLen creates an Average Directional Index (Adx) for offline usage with a source data stream

func NewAdxWithSrcLen

func NewAdxWithSrcLen(sourceLength uint, timePeriod int) (indicator *Adx, err error)

NewAdxWithSrcLen creates an Average Directional Index (Adx) for offline usage

func NewDefaultAdx

func NewDefaultAdx() (indicator *Adx, err error)

NewDefaultAdx creates an Average Directional Index (Adx) for online usage with default parameters

  • timePeriod: 14

func NewDefaultAdxForStream

func NewDefaultAdxForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adx, err error)

NewDefaultAdxForStream creates an Average Directional Index (Adx) for online usage with a source data stream

func NewDefaultAdxForStreamWithSrcLen

func NewDefaultAdxForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adx, err error)

NewDefaultAdxForStreamWithSrcLen creates an Average Directional Index (Adx) for offline usage with a source data stream

func NewDefaultAdxWithSrcLen

func NewDefaultAdxWithSrcLen(sourceLength uint) (indicator *Adx, err error)

NewDefaultAdxWithSrcLen creates an Average Directional Index (Adx) for offline usage with default parameters

func (Adx) UpdateIndicatorWithNewValue

func (ind Adx) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AdxWithoutStorage

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

An Average Directional Index (Adx), no storage, for use in other indicators

func NewAdxWithoutStorage

func NewAdxWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *AdxWithoutStorage, err error)

NewAdxWithoutStorage creates an Average Directional Index (Adx) without storage

func (*AdxWithoutStorage) ReceiveDOHLCVTick

func (ind *AdxWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AdxWithoutStorage) UpdateIndicatorWithNewValue

func (ind AdxWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Adxr

type Adxr struct {
	*AdxrWithoutStorage

	// public variables
	Data []float64
}

A Directional Movement Indicator Rating (Adxr)

func NewAdxr

func NewAdxr(timePeriod int) (indicator *Adxr, err error)

NewAdxr creates an Average Directional Index Rating (Adxr) for online usage

func NewAdxrForStream

func NewAdxrForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Adxr, err error)

NewAdxrForStream creates an Average Directional Rating Index (Adxr) for online usage with a source data stream

func NewAdxrForStreamWithSrcLen

func NewAdxrForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Adxr, err error)

NewAdxrForStreamWithSrcLen creates an Average Directional Index Rating (Adxr) for offline usage with a source data stream

func NewAdxrWithSrcLen

func NewAdxrWithSrcLen(sourceLength uint, timePeriod int) (indicator *Adxr, err error)

NewAdxrWithSrcLen creates an Average Directional Index Rating (Adxr) for offline usage

func NewDefaultAdxr

func NewDefaultAdxr() (indicator *Adxr, err error)

NewDefaultAdxr creates an Average Directional Index Rating (Adxr) for online usage with default parameters

  • timePeriod: 14

func NewDefaultAdxrForStream

func NewDefaultAdxrForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adxr, err error)

NewDefaultAdxrForStream creates an Average Directional Index Rating (Adxr) for online usage with a source data stream

func NewDefaultAdxrForStreamWithSrcLen

func NewDefaultAdxrForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Adxr, err error)

NewDefaultAdxrForStreamWithSrcLen creates an Average Directional Index Rating (Adxr) for offline usage with a source data stream

func NewDefaultAdxrWithSrcLen

func NewDefaultAdxrWithSrcLen(sourceLength uint) (indicator *Adxr, err error)

NewDefaultAdxrWithSrcLen creates an Average Directional Index Rating (Adxr) for offline usage with default parameters

func (Adxr) UpdateIndicatorWithNewValue

func (ind Adxr) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AdxrWithoutStorage

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

An Average Directional Index Rating (Adxr), no storage

func NewAdxrWithoutStorage

func NewAdxrWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *AdxrWithoutStorage, err error)

NewAdxrWithoutStorage creates an Average Directional Index Rating (Adxr) without storage

func (*AdxrWithoutStorage) ReceiveDOHLCVTick

func (ind *AdxrWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AdxrWithoutStorage) UpdateIndicatorWithNewValue

func (ind AdxrWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Aroon

type Aroon struct {
	*AroonWithoutStorage

	// public variables
	Up   []float64
	Down []float64
}

An Aroon (Aroon)

func NewAroon

func NewAroon(timePeriod int) (indicator *Aroon, err error)

NewAroon creates an Aroon (Aroon) for online usage

func NewAroonForStream

func NewAroonForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Aroon, err error)

NewAroonForStream creates an Aroon (Aroon) for online usage with a source data stream

func NewAroonForStreamWithSrcLen

func NewAroonForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Aroon, err error)

NewAroonForStreamWithSrcLen creates an Aroon (Aroon) for online usage with a source data stream

func NewAroonWithSrcLen

func NewAroonWithSrcLen(sourceLength uint, timePeriod int) (indicator *Aroon, err error)

NewAroonWithSrcLen creates an Aroon (Aroon) for offline usage

func NewDefaultAroon

func NewDefaultAroon() (indicator *Aroon, err error)

NewDefaultAroon creates an Aroon (Aroon) for online usage with default parameters

  • timePeriod: 14

func NewDefaultAroonForStream

func NewDefaultAroonForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Aroon, err error)

NewDefaultAroonForStream creates an Aroon (Aroon) for online usage with a source data stream

func NewDefaultAroonForStreamWithSrcLen

func NewDefaultAroonForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Aroon, err error)

NewDefaultAroonForStreamWithSrcLen creates an Aroon (Aroon) for online usage with a source data stream

func NewDefaultAroonWithSrcLen

func NewDefaultAroonWithSrcLen(sourceLength uint) (indicator *Aroon, err error)

NewDefaultAroonWithSrcLen creates an Aroon (Aroon) for offline usage with default parameters

func (Aroon) UpdateIndicatorWithNewValue

func (ind Aroon) UpdateIndicatorWithNewValue(newAroonUpValue float64, newAroonDwnValue float64, streamBarIndex int)

type AroonOsc

type AroonOsc struct {
	*AroonOscWithoutStorage

	// public variables
	Data []float64
}

An AroonOsc (AroonOsc)

func NewAroonOsc

func NewAroonOsc(timePeriod int) (indicator *AroonOsc, err error)

NewAroonOsc creates an Aroon Oscillator (AroonOsc) for online usage

func NewAroonOscForStream

func NewAroonOscForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *AroonOsc, err error)

NewAroonOscForStream creates an Aroon Oscillator (AroonOsc) for online usage with a source data stream

func NewAroonOscForStreamWithSrcLen

func NewAroonOscForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *AroonOsc, err error)

NewAroonOscForStreamWithSrcLen creates an Aroon Oscillator (AroonOsc) for offline usage with a source data stream

func NewAroonOscWithSrcLen

func NewAroonOscWithSrcLen(sourceLength uint, timePeriod int) (indicator *AroonOsc, err error)

NewAroonOscWithSrcLen creates an Aroon Oscillator (AroonOsc) for offline usage

func NewDefaultAroonOsc

func NewDefaultAroonOsc() (indicator *AroonOsc, err error)

NewDefaultAroonOsc creates an Aroon Oscillator (AroonOsc) for online usage with default parameters

  • timePeriod: 14

func NewDefaultAroonOscForStream

func NewDefaultAroonOscForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *AroonOsc, err error)

NewDefaultAroonOscForStream creates an Aroon Oscillator (AroonOsc) for online usage with a source data stream

func NewDefaultAroonOscForStreamWithSrcLen

func NewDefaultAroonOscForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *AroonOsc, err error)

NewDefaultAroonOscForStreamWithSrcLen creates an Aroon Oscillator (AroonOsc) for offline usage with a source data stream

func NewDefaultAroonOscWithSrcLen

func NewDefaultAroonOscWithSrcLen(sourceLength uint) (indicator *AroonOsc, err error)

NewDefaultAroonOscWithSrcLen creates an Aroon Oscillator (AroonOsc) for offline usage with default parameters

func (*AroonOsc) ReceiveDOHLCVTick

func (ind *AroonOsc) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AroonOsc) UpdateIndicatorWithNewValue

func (ind AroonOsc) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AroonOscWithoutStorage

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

func NewAroonOscWithoutStorage

func NewAroonOscWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *AroonOscWithoutStorage, err error)

func (AroonOscWithoutStorage) UpdateIndicatorWithNewValue

func (ind AroonOscWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AroonWithoutStorage

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

An Aroon (Aroon), no storage, for use in other indicators

func NewAroonWithoutStorage

func NewAroonWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionAroon) (indicator *AroonWithoutStorage, err error)

NewAroonWithoutStorage creates an Aroon (Aroon) without storage

func (*AroonWithoutStorage) ReceiveDOHLCVTick

func (ind *AroonWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AroonWithoutStorage) UpdateIndicatorWithNewValue

func (ind AroonWithoutStorage) UpdateIndicatorWithNewValue(newAroonUpValue float64, newAroonDwnValue float64, streamBarIndex int)

type Atr

type Atr struct {
	*AtrWithoutStorage

	// public variables
	Data []float64
}

An Average True Range Indicator (Atr)

func NewAtr

func NewAtr(timePeriod int) (indicator *Atr, err error)

NewAtr creates an Average True Range (Atr) for online usage

func NewAtrForStream

func NewAtrForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Atr, err error)

NewAtrForStream creates an Average True Range (Atr) for online usage with a source data stream

func NewAtrForStreamWithSrcLen

func NewAtrForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Atr, err error)

NewAtrForStreamWithSrcLen creates an Average True Range (Atr) for offline usage with a source data stream

func NewAtrWithSrcLen

func NewAtrWithSrcLen(sourceLength uint, timePeriod int) (indicator *Atr, err error)

NewAtrWithSrcLen creates an Average True Range (Atr) for offline usage

func NewDefaultAtr

func NewDefaultAtr() (indicator *Atr, err error)

NewDefaultAtr creates an Average True Range (Atr) for online usage with default parameters

  • timePeriod: 14

func NewDefaultAtrForStream

func NewDefaultAtrForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Atr, err error)

NewDefaultAtrForStream creates an Average True Range (Atr) for online usage with a source data stream

func NewDefaultAtrForStreamWithSrcLen

func NewDefaultAtrForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Atr, err error)

NewDefaultAtrForStreamWithSrcLen creates an Average True Range (Atr) for offline usage with a source data stream

func NewDefaultAtrWithSrcLen

func NewDefaultAtrWithSrcLen(sourceLength uint) (indicator *Atr, err error)

NewDefaultAtrWithSrcLen creates an Average True Range (Atr) for offline usage with default parameters

func (Atr) UpdateIndicatorWithNewValue

func (ind Atr) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AtrWithoutStorage

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

An Average True Range Indicator (Atr), no storage, for use in other indicators

func NewAtrWithoutStorage

func NewAtrWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *AtrWithoutStorage, err error)

NewAtrWithoutStorage creates an Average True Range Indicator (Atr) without storage

func (*AtrWithoutStorage) ReceiveDOHLCVTick

func (ind *AtrWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AtrWithoutStorage) UpdateIndicatorWithNewValue

func (ind AtrWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AvgPrice

type AvgPrice struct {
	*AvgPriceWithoutStorage

	// public variables
	Data []float64
}

An Average Price Indicator

func NewAvgPrice

func NewAvgPrice() (indicator *AvgPrice, err error)

NewAvgPrice creates an Average Price (AvgPrice) for online usage

func NewAvgPriceForStream

func NewAvgPriceForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *AvgPrice, err error)

NewAvgPriceForStream creates an Avgerage Price Indicator(AvgPrice) for online usage with a source data stream

func NewAvgPriceForStreamWithSrcLen

func NewAvgPriceForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *AvgPrice, err error)

NewAvgPriceForStreamWithSrcLen creates an Avgerage Price Indicator(AvgPrice) for offline usage with a source data stream

func NewAvgPriceWithSrcLen

func NewAvgPriceWithSrcLen(sourceLength uint) (indicator *AvgPrice, err error)

NewAvgPriceWithSrcLen creates an Avgerage Price Indicator(AvgPrice) for offline usage

func (AvgPrice) UpdateIndicatorWithNewValue

func (ind AvgPrice) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type AvgPriceWithoutStorage

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

An Average Price (AvgPrice), no storage, for use in other indicators

func NewAvgPriceWithoutStorage

func NewAvgPriceWithoutStorage(valueAvailableAction ValueAvailableActionFloat) (indicator *AvgPriceWithoutStorage, err error)

NewAvgPriceWithoutStorage creates an Average Price(AvgPrice) without storage

func (*AvgPriceWithoutStorage) ReceiveDOHLCVTick

func (ind *AvgPriceWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (AvgPriceWithoutStorage) UpdateIndicatorWithNewValue

func (ind AvgPriceWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type BollingerBands

type BollingerBands struct {
	*BollingerBandsWithoutStorage

	// public variables
	UpperBand  []float64
	MiddleBand []float64
	LowerBand  []float64
	// contains filtered or unexported fields
}

A Bollinger Band Indicator

func NewBollingerBands

func NewBollingerBands(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *BollingerBands, err error)

NewBollingerBands creates a Bollinger Band Indicator (BollingerBand) for online usage

func NewBollingerBandsForStream

func NewBollingerBandsForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *BollingerBands, err error)

NewBollingerBandsForStream creates a Bollinger Bands Indicator (BollingerBand) for online usage with a source data stream

func NewBollingerBandsForStreamWithSrcLen

func NewBollingerBandsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *BollingerBands, err error)

NewBollingerBandsForStreamWithSrcLen creates a Bollinger Bands Indicator (BollingerBand) for online usage with a source data stream

func NewBollingerBandsWithSrcLen

func NewBollingerBandsWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *BollingerBands, err error)

NewBollingerBandsWithSrcLen creates a Bollinger Band Indicator (BollingerBand) for offline usage

func NewDefaultBollingerBands

func NewDefaultBollingerBands() (indicator *BollingerBands, err error)

NewDefaultBollingerBands creates a Bollinger Band Indicator (BollingerBand) for online usage with default parameters

  • timePeriod: 5
  • selectData: useClosePrice

func NewDefaultBollingerBandsForStream

func NewDefaultBollingerBandsForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *BollingerBands, err error)

NewDefaultBollingerBandsForStream creates a Bollinger Bands Indicator (BollingerBand) for online usage with a source data stream

func NewDefaultBollingerBandsForStreamWithSrcLen

func NewDefaultBollingerBandsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *BollingerBands, err error)

NewDefaultBollingerBandsForStreamWithSrcLen creates a Bollinger Bands Indicator (BollingerBand) for online usage with a source data stream

func NewDefaultBollingerBandsWithSrcLen

func NewDefaultBollingerBandsWithSrcLen(sourceLength uint) (indicator *BollingerBands, err error)

NewDefaultBollingerBandsWithSrcLen creates a Bollinger Band Indicator (BollingerBand) for offline usage

func (*BollingerBands) ReceiveDOHLCVTick

func (ind *BollingerBands) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (BollingerBands) UpdateIndicatorWithNewValue

func (ind BollingerBands) UpdateIndicatorWithNewValue(newUpperBandValue float64, newMiddleBandValue float64, newLowerBandValue float64, streamBarIndex int)

type BollingerBandsWithoutStorage

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

A Bollinger Band Indicator (BollingerBand), no storage, for use in other indicators

func NewBollingerBandsWithoutStorage

func NewBollingerBandsWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionBollinger) (indicator *BollingerBandsWithoutStorage, err error)

NewBollingerBandsWithoutStorage creates a Bollinger Band Indicator (BollingerBand) without storage

func (*BollingerBandsWithoutStorage) RecieveTick

func (ind *BollingerBandsWithoutStorage) RecieveTick(tickData float64, streamBarIndex int)

ReceiveTick consumes a source data float price tick

func (BollingerBandsWithoutStorage) UpdateIndicatorWithNewValue

func (ind BollingerBandsWithoutStorage) UpdateIndicatorWithNewValue(newUpperBandValue float64, newMiddleBandValue float64, newLowerBandValue float64, streamBarIndex int)

type Cci

type Cci struct {
	*CciWithoutStorage

	// public variables
	Data []float64
}

A Commodity Channel Index Indicator (Cci)

func NewCci

func NewCci(timePeriod int) (indicator *Cci, err error)

NewCci creates a Commodity Channel Index Indicator (Cci) for online usage

func NewCciForStream

func NewCciForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Cci, err error)

NewCciForStream creates a Commodity Channel Index (Cci) for online usage with a source data stream

func NewCciForStreamWithSrcLen

func NewCciForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Cci, err error)

NewCciForStreamWithSrcLen creates a Commodity Channel Index (Cci) for offline usage with a source data stream

func NewCciWithSrcLen

func NewCciWithSrcLen(sourceLength uint, timePeriod int) (indicator *Cci, err error)

NewCciWithSrcLen creates a Commodity Channel Index (Cci) for offline usage

func NewDefaultCci

func NewDefaultCci() (indicator *Cci, err error)

NewDefaultCci creates a Commodity Channel Index (Cci) for online usage with default parameters

  • timePeriod: 14

func NewDefaultCciForStream

func NewDefaultCciForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Cci, err error)

NewDefaultCciForStream creates a Commodity Channel Index (Cci) for online usage with a source data stream

func NewDefaultCciForStreamWithSrcLen

func NewDefaultCciForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Cci, err error)

NewDefaultCciForStreamWithSrcLen creates a Commodity Channel Index (Cci) for offline usage with a source data stream

func NewDefaultCciWithSrcLen

func NewDefaultCciWithSrcLen(sourceLength uint) (indicator *Cci, err error)

NewDefaultCciWithSrcLen creates a Commodity Channel Index (Cci) for offline usage with default parameters

func (*Cci) ReceiveDOHLCVTick

func (ind *Cci) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Cci) UpdateIndicatorWithNewValue

func (ind Cci) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type CciWithoutStorage

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

A Commodity Channel Index Indicator (Cci), no storage, for use in other indicators

func NewCciWithoutStorage

func NewCciWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *CciWithoutStorage, err error)

NewCciWithoutStorage creates a Commodity Channel Index Indicator (Cci) without storage

func (CciWithoutStorage) UpdateIndicatorWithNewValue

func (ind CciWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type ChaikinOsc

type ChaikinOsc struct {
	*ChaikinOscWithoutStorage

	// public variables
	Data []float64
}

A Chaikin Oscillator Indicator (ChaikinOsc)

func NewChaikinOsc

func NewChaikinOsc(fastTimePeriod int, slowTimePeriod int) (indicator *ChaikinOsc, err error)

NewChaikinOsc creates a Chaikin Oscillator (ChaikinOsc) for online usage

func NewChaikinOscForStream

func NewChaikinOscForStream(priceStream gotrade.DOHLCVStreamSubscriber, fastTimePeriod int, slowTimePeriod int) (indicator *ChaikinOsc, err error)

NewChaikinOscForStream creates a Chaikin Oscillator (ChaikinOsc) for online usage with a source data stream

func NewChaikinOscForStreamWithSrcLen

func NewChaikinOscForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, fastTimePeriod int, slowTimePeriod int) (indicator *ChaikinOsc, err error)

NewChaikinOscForStreamWithSrcLen creates a Chaikin Oscillator (ChaikinOsc) for offline usage with a source data stream

func NewChaikinOscWithSrcLen

func NewChaikinOscWithSrcLen(sourceLength uint, fastTimePeriod int, slowTimePeriod int) (indicator *ChaikinOsc, err error)

NewChaikinOscWithSrcLen creates a Chaikin Oscillator (ChaikinOsc) for offline usage

func NewDefaultChaikinOsc

func NewDefaultChaikinOsc() (indicator *ChaikinOsc, err error)

NewDefaultChaikinOsc creates a Chaikin Oscillator (ChaikinOsc) for online usage with default parameters

  • fastTimePeriod: 3
  • slowTimePeriod: 10

func NewDefaultChaikinOscForStream

func NewDefaultChaikinOscForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *ChaikinOsc, err error)

NewDefaultChaikinOscForStream creates a Chaikin Oscillator (ChaikinOsc) for online usage with a source data stream

func NewDefaultChaikinOscForStreamWithSrcLen

func NewDefaultChaikinOscForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *ChaikinOsc, err error)

NewDefaultChaikinOscForStreamWithSrcLen creates a Chaikin Oscillator (ChaikinOsc) for offline usage with a source data stream

func NewDefaultChaikinOscWithSrcLen

func NewDefaultChaikinOscWithSrcLen(sourceLength uint) (indicator *ChaikinOsc, err error)

NewDefaultChaikinOscWithSrcLen creates a Chaikin Oscillator (ChaikinOsc) for offline usage with default parameters

func (*ChaikinOsc) ReceiveDOHLCVTick

func (ind *ChaikinOsc) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (ChaikinOsc) UpdateIndicatorWithNewValue

func (ind ChaikinOsc) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type ChaikinOscWithoutStorage

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

A Chaikin Oscillator Indicator (ChaikinOsc), no storage, for use in other indicators

func NewChaikinOscWithoutStorage

func NewChaikinOscWithoutStorage(fastTimePeriod int, slowTimePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *ChaikinOscWithoutStorage, err error)

NewChaikinOscWithoutStorage creates a Chaikin Oscillator Indicator (ChaikinOsc) without storage This should be as simple as EMA(Adl,3) - EMA(Adl,10), however it seems the TA-Lib emas are intialised with the first adl value and not offset like the macd to conincide, they are both calculated from the 2nd bar and used before their lookback period is reached - so the emas are calculated inline and not using the general EmaWithoutStorage

func (ChaikinOscWithoutStorage) UpdateIndicatorWithNewValue

func (ind ChaikinOscWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Dema

type Dema struct {
	*DemaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Double Exponential Moving Average Indicator (Dema)

func NewDefaultDema

func NewDefaultDema() (indicator *Dema, err error)

NewDefaultDema creates a Double Exponential Moving Average (Dema) for online usage with default parameters

  • timePeriod: 30
  • selectData: useClosePrice

func NewDefaultDemaForStream

func NewDefaultDemaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Dema, err error)

NewDefaultDemaForStream creates a Double Exponential Moving Average (Dema) for online usage with a source data stream

func NewDefaultDemaForStreamWithSrcLen

func NewDefaultDemaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Dema, err error)

NewDefaultDemaForStreamWithSrcLen creates a Double Exponential Moving Average (Dema) for offline usage with a source data stream

func NewDefaultDemaWithSrcLen

func NewDefaultDemaWithSrcLen(sourceLength uint) (indicator *Dema, err error)

NewDefaultDemaWithSrcLen creates a Double Exponential Moving Average (Dema) for offline usage with default parameters

func NewDema

func NewDema(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Dema, err error)

NewDema creates a Double Exponential Moving Average (Dema) for online usage

func NewDemaForStream

func NewDemaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Dema, err error)

NewDemaForStream creates a Double Exponential Moving Average (Dema) for online usage with a source data stream

func NewDemaForStreamWithSrcLen

func NewDemaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Dema, err error)

NewDemaForStreamWithSrcLen creates a Double Exponential Moving Average (Dema) for offline usage with a source data stream

func NewDemaWithSrcLen

func NewDemaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Dema, err error)

NewDemaWithSrcLen creates a Double Exponential Moving Average (Dema) for offline usage

func (*Dema) ReceiveDOHLCVTick

func (dema *Dema) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Dema) UpdateIndicatorWithNewValue

func (ind Dema) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type DemaWithoutStorage

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

A Double Exponential Moving Average Indicator (Dema), no storage, for use in other indicators

func NewDemaWithoutStorage

func NewDemaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *DemaWithoutStorage, err error)

NewDemaWithoutStorage creates a Double Exponential Moving Average Indicator (Dema) without storage

func (*DemaWithoutStorage) ReceiveTick

func (dema *DemaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (DemaWithoutStorage) UpdateIndicatorWithNewValue

func (ind DemaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Dx

type Dx struct {
	*DxWithoutStorage

	// public variables
	Data []float64
}

A Directional Movement Index Indicator (Dx)

func NewDefaultDx

func NewDefaultDx() (indicator *Dx, err error)

NewDefaultDx creates a Directional Movement Index (Dx) for online usage with default parameters

  • timePeriod: 14

func NewDefaultDxForStream

func NewDefaultDxForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Dx, err error)

NewDefaultDxForStream creates a Directional Movement Index (Dx) for online usage with a source data stream

func NewDefaultDxForStreamWithSrcLen

func NewDefaultDxForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Dx, err error)

NewDefaultDxForStreamWithSrcLen creates a Directional Movement Index (Dx) for offline usage with a source data stream

func NewDefaultDxWithSrcLen

func NewDefaultDxWithSrcLen(sourceLength uint) (indicator *Dx, err error)

NewDefaultDxWithSrcLen creates a Directional Movement Index (Dx) for offline usage with default parameters

func NewDx

func NewDx(timePeriod int) (indicator *Dx, err error)

NewDx creates a Directional Movement Index Indicator (Dx) for online usage

func NewDxForStream

func NewDxForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Dx, err error)

NewDxForStream creates a Directional Movement Index (Dx) for online usage with a source data stream

func NewDxForStreamWithSrcLen

func NewDxForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Dx, err error)

NewDxForStreamWithSrcLen creates a Directional Movement Index (Dx) for offline usage with a source data stream

func NewDxWithSrcLen

func NewDxWithSrcLen(sourceLength uint, timePeriod int) (indicator *Dx, err error)

NewDxWithSrcLen creates a Directional Movement Index (Dx) for offline usage

func (Dx) UpdateIndicatorWithNewValue

func (ind Dx) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type DxWithoutStorage

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

An Directional Movement Index Indicator (Dx), no storage, for use in other indicators

func NewDxWithoutStorage

func NewDxWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *DxWithoutStorage, err error)

NewDxWithoutStorage creates a Directional Movement Index Indicator (Dx) without storage

func (*DxWithoutStorage) ReceiveDOHLCVTick

func (ind *DxWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (DxWithoutStorage) UpdateIndicatorWithNewValue

func (ind DxWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Ema

type Ema struct {
	*EmaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

An Exponential Moving Average Indicator (Ema)

func NewDefaultEma

func NewDefaultEma() (indicator *Ema, err error)

NewDefaultEma creates an Exponential Moving Average (Ema) for online usage with default parameters

  • timePeriod: 25

func NewDefaultEmaForStream

func NewDefaultEmaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Ema, err error)

NewDefaultEmaForStream creates an Exponential Moving Average (Ema) for online usage with a source data stream

func NewDefaultEmaForStreamWithSrcLen

func NewDefaultEmaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Ema, err error)

NewDefaultEmaForStreamWithSrcLen creates an Exponential Moving Average (Ema) for offline usage with a source data stream

func NewDefaultEmaWithSrcLen

func NewDefaultEmaWithSrcLen(sourceLength uint) (indicator *Ema, err error)

NewDefaultEmaWithSrcLen creates an Exponential Moving Average (Ema) for offline usage with default parameters

func NewEma

func NewEma(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Ema, err error)

NewEma creates an Exponential Moving Average Indicator (Ema) for online usage

func NewEmaForStream

func NewEmaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Ema, err error)

NewEmaForStream creates an Exponential Moving Average (Ema) for online usage with a source data stream

func NewEmaForStreamWithSrcLen

func NewEmaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Ema, err error)

NewEmaForStreamWithSrcLen creates an Exponential Moving Average (Ema) for offline usage with a source data stream

func NewEmaWithSrcLen

func NewEmaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Ema, err error)

NewEmaWithSrcLen creates an Exponential Moving Average (Ema) for offline usage

func (*Ema) ReceiveDOHLCVTick

func (ind *Ema) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Ema) UpdateIndicatorWithNewValue

func (ind Ema) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type EmaWithoutStorage

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

An Exponential Moving Average Indicator (Ema), no storage, for use in other indicators

func NewEmaWithoutStorage

func NewEmaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *EmaWithoutStorage, err error)

NewEmaWithoutStorage creates an Exponential Moving Average Indicator (Ema) without storage

func (*EmaWithoutStorage) ReceiveTick

func (ind *EmaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (EmaWithoutStorage) UpdateIndicatorWithNewValue

func (ind EmaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Hhv

type Hhv struct {
	*HhvWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Highest High Value Indicator (hhv)

func NewDefaultHhv

func NewDefaultHhv() (indicator *Hhv, err error)

NewDefaultHhv creates a Highest High Value Indicator (Hhv) for online usage with default parameters

  • timePeriod: 25

func NewDefaultHhvForStream

func NewDefaultHhvForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Hhv, err error)

NewDefaultHhvForStream creates a Highest High Value Indicator (Hhv)for online usage with a source data stream

func NewDefaultHhvForStreamWithSrcLen

func NewDefaultHhvForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Hhv, err error)

NewDefaultHhvForStreamWithSrcLen creates a Highest High Value Indicator (Hhv)for offline usage with a source data stream

func NewDefaultHhvWithSrcLen

func NewDefaultHhvWithSrcLen(sourceLength uint) (indicator *Hhv, err error)

NewDefaultHhvWithSrcLen creates a Highest High Value Indicator (Hhv)for offline usage with default parameters

func NewHhv

func NewHhv(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Hhv, err error)

NewHhv creates a Highest High Value Indicator (Hhv) for online usage

func NewHhvForStream

func NewHhvForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Hhv, err error)

NewHhvForStream creates a Highest High Value Indicator (Hhv)for online usage with a source data stream

func NewHhvForStreamWithSrcLen

func NewHhvForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Hhv, err error)

NewHhvForStreamWithSrcLen creates a Highest High Value Indicator (Hhv)for offline usage with a source data stream

func NewHhvWithSrcLen

func NewHhvWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Hhv, err error)

NewHhvWithSrcLen creates a Highest High Value Indicator (Hhv)for offline usage

func (*Hhv) ReceiveDOHLCVTick

func (ind *Hhv) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Hhv) UpdateIndicatorWithNewValue

func (ind Hhv) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type HhvBars

type HhvBars struct {
	*HhvBarsWithoutStorage

	// public variables
	Data []int64
	// contains filtered or unexported fields
}

A Highest High Value Bars Indicator (HhvBars)

func NewDefaultHhvBars

func NewDefaultHhvBars() (indicator *HhvBars, err error)

NewDefaultHhvBars creates a Highest High Value Indicator (HhvBars) for online usage with default parameters

  • timePeriod: 25

func NewDefaultHhvBarsForStream

func NewDefaultHhvBarsForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *HhvBars, err error)

NewDefaultHhvBarsForStream creates a Highest High Value Indicator (HhvBars)for online usage with a source data stream

func NewDefaultHhvBarsForStreamWithSrcLen

func NewDefaultHhvBarsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *HhvBars, err error)

NewDefaultHhvBarsForStreamWithSrcLen creates a Highest High Value Indicator (HhvBars)for offline usage with a source data stream

func NewDefaultHhvBarsWithSrcLen

func NewDefaultHhvBarsWithSrcLen(sourceLength uint) (indicator *HhvBars, err error)

NewDefaultHhvBarsWithSrcLen creates a Highest High Value Indicator (HhvBars)for offline usage with default parameters

func NewHhvBars

func NewHhvBars(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *HhvBars, err error)

NewHhvBars creates a Highest High Value Bars Indicator (HhvBars) for online usage

func NewHhvBarsForStream

func NewHhvBarsForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *HhvBars, err error)

NewHhvBarsForStream creates a Highest High Value Indicator (HhvBars)for online usage with a source data stream

func NewHhvBarsForStreamWithSrcLen

func NewHhvBarsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *HhvBars, err error)

NewHhvBarsForStreamWithSrcLen creates a Highest High Value Indicator (HhvBars)for offline usage with a source data stream

func NewHhvBarsWithSrcLen

func NewHhvBarsWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *HhvBars, err error)

NewHhvBarsWithSrcLen creates a Highest High Value Indicator (HhvBars)for offline usage

func (*HhvBars) ReceiveDOHLCVTick

func (ind *HhvBars) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (HhvBars) UpdateIndicatorWithNewValue

func (ind HhvBars) UpdateIndicatorWithNewValue(newValue int64, streamBarIndex int)

type HhvBarsWithoutStorage

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

A Highest High Value Bars Indicator (HhvBars), no storage, for use in other indicators

func NewHhvBarsWithoutStorage

func NewHhvBarsWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionInt) (indicator *HhvBarsWithoutStorage, err error)

NewHhvBarsWithoutStorage creates a Highest High Value Bars Indicator Indicator (HhvBars) without storage

func (*HhvBarsWithoutStorage) ReceiveTick

func (ind *HhvBarsWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (HhvBarsWithoutStorage) UpdateIndicatorWithNewValue

func (ind HhvBarsWithoutStorage) UpdateIndicatorWithNewValue(newValue int64, streamBarIndex int)

type HhvWithoutStorage

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

A Highest High Value Indicator (Hhv), no storage, for use in other indicators

func NewHhvWithoutStorage

func NewHhvWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *HhvWithoutStorage, err error)

NewHhvWithoutStorage creates a Highest High Value Indicator (Hhv) without storage

func (*HhvWithoutStorage) ReceiveTick

func (ind *HhvWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (HhvWithoutStorage) UpdateIndicatorWithNewValue

func (ind HhvWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Indicator

type Indicator interface {
	// the source data bar number from which this indicator is valid, starts at bar 1.
	ValidFromBar() int
	// the lookback period, if applicable, the amount of lag the indicator displays with regards to the source data.
	GetLookbackPeriod() int
	// the length of the transformed data generated by the indicator.
	Length() int
}

type IndicatorWithFloatBounds

type IndicatorWithFloatBounds interface {
	// the minimum bound of the transformed data generated by the indicator.
	MinValue() float64
	// the maximum bound of the transformed data generated by the indicator.
	MaxValue() float64
}

type IndicatorWithIntBounds

type IndicatorWithIntBounds interface {
	// the minimum bound of the transformed data generated by the indicator.
	MinValue() int64
	// the maximum bound of the transformed data generated by the indicator.
	MaxValue() int64
}

type IndicatorWithTimePeriod

type IndicatorWithTimePeriod interface {
	GetTimePeriod() int
}

type Kama

type Kama struct {
	*KamaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Kaufman Adaptive Moving Average Indicator (Kama)

func NewDefaultKama

func NewDefaultKama() (indicator *Kama, err error)

NewDefaultKama creates a Kaufman Adaptive Moving Average Indicator (Kama) for online usage with default parameters

  • timePeriod: 25

func NewDefaultKamaForStream

func NewDefaultKamaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Kama, err error)

NewDefaultKamaForStream creates a Kaufman Adaptive Moving Average Indicator (Kama) for online usage with a source data stream

func NewDefaultKamaForStreamWithSrcLen

func NewDefaultKamaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Kama, err error)

NewDefaultKamaForStreamWithSrcLen creates a Kaufman Adaptive Moving Average Indicator (Kama) for offline usage with a source data stream

func NewDefaultKamaWithSrcLen

func NewDefaultKamaWithSrcLen(sourceLength uint) (indicator *Kama, err error)

NewDefaultKamaWithSrcLen creates a Kaufman Adaptive Moving Average Indicator (Kama) for offline usage with default parameters

func NewKama

func NewKama(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error)

NewKama creates a Kaufman Adaptive Moving Average Indicator (Kama) for online usage

func NewKamaForStream

func NewKamaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error)

NewKamaForStream creates a Kaufman Adaptive Moving Average Indicator (Kama) for online usage with a source data stream

func NewKamaForStreamWithSrcLen

func NewKamaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error)

NewKamaForStreamWithSrcLen creates a Kaufman Adaptive Moving Average Indicator (Kama) for offline usage with a source data stream

func NewKamaWithSrcLen

func NewKamaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Kama, err error)

NewKamaWithSrcLen creates a Kaufman Adaptive Moving Average Indicator (Kama) for offline usage

func (*Kama) ReceiveDOHLCVTick

func (ind *Kama) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Kama) UpdateIndicatorWithNewValue

func (ind Kama) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type KamaWithoutStorage

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

A Kaufman Adaptive Moving Average Indicator (Kama), no storage, for use in other indicators

func NewKamaWithoutStorage

func NewKamaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *KamaWithoutStorage, err error)

NewKamaWithoutStorage creates a Kaufman Adaptive Moving Average Indicator (Kama) without storage

func (*KamaWithoutStorage) ReceiveTick

func (ind *KamaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (KamaWithoutStorage) UpdateIndicatorWithNewValue

func (ind KamaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type LinReg

type LinReg struct {
	*LinRegWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Linear Regression Indicator (LinReg)

func NewDefaultLinReg

func NewDefaultLinReg() (indicator *LinReg, err error)

NewDefaultLinReg creates a Linear Regression Indicator (LinReg) for online usage with default parameters

  • timePeriod: 14

func NewDefaultLinRegForStream

func NewDefaultLinRegForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinReg, err error)

NewDefaultLinRegForStream creates a Linear Regression Indicator (LinReg) for online usage with a source data stream

func NewDefaultLinRegForStreamWithSrcLen

func NewDefaultLinRegForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinReg, err error)

NewDefaultLinRegForStreamWithSrcLen creates a Linear Regression Indicator (LinReg) for offline usage with a source data stream

func NewDefaultLinRegWithSrcLen

func NewDefaultLinRegWithSrcLen(sourceLength uint) (indicator *LinReg, err error)

NewDefaultLinRegWithSrcLen creates a Linear Regression Indicator (LinReg) for offline usage with default parameters

func NewLinReg

func NewLinReg(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinReg, err error)

NewLinReg creates a Linear Regression Indicator (LinReg) for online usage

func NewLinRegForStream

func NewLinRegForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinReg, err error)

NewLinRegForStream creates a Linear Regression Indicator (LinReg) for online usage with a source data stream

func NewLinRegForStreamWithSrcLen

func NewLinRegForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinReg, err error)

NewLinRegForStreamWithSrcLen creates a Linear Regression Indicator (LinReg) for offline usage with a source data stream

func NewLinRegWithSrcLen

func NewLinRegWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinReg, err error)

NewLinRegWithSrcLen creates a Linear Regression Indicator (LinReg) for offline usage

func (LinReg) GetLookbackPeriod

func (ind LinReg) GetLookbackPeriod() int

func (LinReg) IncDataLength

func (ind LinReg) IncDataLength()

func (LinReg) Length

func (ind LinReg) Length() int

func (LinReg) MaxValue

func (ind LinReg) MaxValue() float64

func (LinReg) MinValue

func (ind LinReg) MinValue() float64

func (*LinReg) ReceiveDOHLCVTick

func (ind *LinReg) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (LinReg) SetValidFromBar

func (ind LinReg) SetValidFromBar(streamBarIndex int)

func (LinReg) UpdateMinMax

func (ind LinReg) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (LinReg) ValidFromBar

func (ind LinReg) ValidFromBar() int

type LinRegAng

type LinRegAng struct {
	*LinRegWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Linear Regression Angle Indicator (LinRegAng)

func NewDefaultLinRegAng

func NewDefaultLinRegAng() (indicator *LinRegAng, err error)

NewDefaultLinRegAng creates a Linear Regression Angle Indicator (LinRegAng) for online usage with default parameters

  • timePeriod: 14

func NewDefaultLinRegAngForStream

func NewDefaultLinRegAngForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegAng, err error)

NewDefaultLinRegAngForStream creates a Linear Regression Angle Indicator (LinRegAng) for online usage with a source data stream

func NewDefaultLinRegAngForStreamWithSrcLen

func NewDefaultLinRegAngForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegAng, err error)

NewDefaultLinRegAngForStreamWithSrcLen creates a Linear Regression Angle Indicator (LinRegAng) for offline usage with a source data stream

func NewDefaultLinRegAngWithSrcLen

func NewDefaultLinRegAngWithSrcLen(sourceLength uint) (indicator *LinRegAng, err error)

NewDefaultLinRegAngWithSrcLen creates a Linear Regression Angle Indicator (LinRegAng) for offline usage with default parameters

func NewLinRegAng

func NewLinRegAng(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegAng, err error)

NewLinRegAng creates a Linear Regression Angle Indicator (LinRegAng) for online usage

func NewLinRegAngForStream

func NewLinRegAngForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegAng, err error)

NewLinRegAngForStream creates a Linear Regression Angle Indicator (LinRegAng) for online usage with a source data stream

func NewLinRegAngForStreamWithSrcLen

func NewLinRegAngForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegAng, err error)

NewLinRegAngForStreamWithSrcLen creates a Linear Regression Angle Indicator (LinRegAng) for offline usage with a source data stream

func NewLinRegAngWithSrcLen

func NewLinRegAngWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegAng, err error)

NewLinRegAngWithSrcLen creates a Linear Regression Angle Indicator (LinRegAng) for offline usage

func (LinRegAng) GetLookbackPeriod

func (ind LinRegAng) GetLookbackPeriod() int

func (LinRegAng) IncDataLength

func (ind LinRegAng) IncDataLength()

func (LinRegAng) Length

func (ind LinRegAng) Length() int

func (LinRegAng) MaxValue

func (ind LinRegAng) MaxValue() float64

func (LinRegAng) MinValue

func (ind LinRegAng) MinValue() float64

func (*LinRegAng) ReceiveDOHLCVTick

func (ind *LinRegAng) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (LinRegAng) SetValidFromBar

func (ind LinRegAng) SetValidFromBar(streamBarIndex int)

func (LinRegAng) UpdateMinMax

func (ind LinRegAng) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (LinRegAng) ValidFromBar

func (ind LinRegAng) ValidFromBar() int

type LinRegInt

type LinRegInt struct {
	*LinRegWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Linear Regression Intercept Indicator (LinRegInt)

func NewDefaultLinRegInt

func NewDefaultLinRegInt() (indicator *LinRegInt, err error)

NewDefaultLinRegInt creates a Linear Regression Intercept Indicator (LinRegInt) for online usage with default parameters

  • timePeriod: 14

func NewDefaultLinRegIntForStream

func NewDefaultLinRegIntForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegInt, err error)

NewDefaultLinRegIntForStream creates a Linear Regression Intercept Indicator (LinRegInt) for online usage with a source data stream

func NewDefaultLinRegIntForStreamWithSrcLen

func NewDefaultLinRegIntForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegInt, err error)

NewDefaultLinRegIntForStreamWithSrcLen creates a Linear Regression Intercept Indicator (LinRegInt) for offline usage with a source data stream

func NewDefaultLinRegIntWithSrcLen

func NewDefaultLinRegIntWithSrcLen(sourceLength uint) (indicator *LinRegInt, err error)

NewDefaultLinRegIntWithSrcLen creates a Linear Regression Intercept Indicator (LinRegInt) for offline usage with default parameters

func NewLinRegInt

func NewLinRegInt(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegInt, err error)

NewLinRegInt creates a Linear Regression Intercept Indicator (LinRegInt) for online usage

func NewLinRegIntForStream

func NewLinRegIntForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegInt, err error)

NewLinRegIntForStream creates a Linear Regression Intercept Indicator (LinRegInt) for online usage with a source data stream

func NewLinRegIntForStreamWithSrcLen

func NewLinRegIntForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegInt, err error)

NewLinRegIntForStreamWithSrcLen creates a Linear Regression Intercept Indicator (LinRegInt) for offline usage with a source data stream

func NewLinRegIntWithSrcLen

func NewLinRegIntWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegInt, err error)

NewLinRegIntWithSrcLen creates a Linear Regression Intercept Indicator (LinRegInt) for offline usage

func (LinRegInt) GetLookbackPeriod

func (ind LinRegInt) GetLookbackPeriod() int

func (LinRegInt) IncDataLength

func (ind LinRegInt) IncDataLength()

func (LinRegInt) Length

func (ind LinRegInt) Length() int

func (LinRegInt) MaxValue

func (ind LinRegInt) MaxValue() float64

func (LinRegInt) MinValue

func (ind LinRegInt) MinValue() float64

func (*LinRegInt) ReceiveDOHLCVTick

func (ind *LinRegInt) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (LinRegInt) SetValidFromBar

func (ind LinRegInt) SetValidFromBar(streamBarIndex int)

func (LinRegInt) UpdateMinMax

func (ind LinRegInt) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (LinRegInt) ValidFromBar

func (ind LinRegInt) ValidFromBar() int

type LinRegSlp

type LinRegSlp struct {
	*LinRegWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Linear Regression Intercept Indicator (LinRegInt)

func NewDefaultLinRegSlp

func NewDefaultLinRegSlp() (indicator *LinRegSlp, err error)

NewDefaultLinRegSlp creates a Linear Regression Slope Indicator (LinRegSlp) for online usage with default parameters

  • timePeriod: 14

func NewDefaultLinRegSlpForStream

func NewDefaultLinRegSlpForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegSlp, err error)

NewDefaultLinRegSlpForStream creates a Linear Regression Slope Indicator (LinRegSlp) for online usage with a source data stream

func NewDefaultLinRegSlpForStreamWithSrcLen

func NewDefaultLinRegSlpForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LinRegSlp, err error)

NewDefaultLinRegSlpForStreamWithSrcLen creates a Linear Regression Slope Indicator (LinRegSlp) for offline usage with a source data stream

func NewDefaultLinRegSlpWithSrcLen

func NewDefaultLinRegSlpWithSrcLen(sourceLength uint) (indicator *LinRegSlp, err error)

NewDefaultLinRegSlpWithSrcLen creates a Linear Regression Slope Indicator (LinRegSlp) for offline usage with default parameters

func NewLinRegSlp

func NewLinRegSlp(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegSlp, err error)

NewLinRegSlp creates a Linear Regression Slope Indicator (LinRegSlp) for online usage

func NewLinRegSlpForStream

func NewLinRegSlpForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegSlp, err error)

NewLinRegSlpForStream creates a Linear Regression Slope Indicator (LinRegSlp) for online usage with a source data stream

func NewLinRegSlpForStreamWithSrcLen

func NewLinRegSlpForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegSlp, err error)

NewLinRegSlpForStreamWithSrcLen creates a Linear Regression Slope Indicator (LinRegSlp) for offline usage with a source data stream

func NewLinRegSlpWithSrcLen

func NewLinRegSlpWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LinRegSlp, err error)

NewLinRegSlpWithSrcLen creates a Linear Regression Slope Indicator (LinRegSlp) for offline usage

func (LinRegSlp) GetLookbackPeriod

func (ind LinRegSlp) GetLookbackPeriod() int

func (LinRegSlp) IncDataLength

func (ind LinRegSlp) IncDataLength()

func (LinRegSlp) Length

func (ind LinRegSlp) Length() int

func (LinRegSlp) MaxValue

func (ind LinRegSlp) MaxValue() float64

func (LinRegSlp) MinValue

func (ind LinRegSlp) MinValue() float64

func (*LinRegSlp) ReceiveDOHLCVTick

func (ind *LinRegSlp) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (LinRegSlp) SetValidFromBar

func (ind LinRegSlp) SetValidFromBar(streamBarIndex int)

func (LinRegSlp) UpdateMinMax

func (ind LinRegSlp) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (LinRegSlp) ValidFromBar

func (ind LinRegSlp) ValidFromBar() int

type LinRegWithoutStorage

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

A Linear Regression Indicator (LinReg), no storage, for use in other indicators

func NewLinRegWithoutStorage

func NewLinRegWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionLinearReg) (indicator *LinRegWithoutStorage, err error)

NewLinRegWithoutStorage creates a Linear Regression Indicator (LinReg) without storage

func (LinRegWithoutStorage) GetLookbackPeriod

func (ind LinRegWithoutStorage) GetLookbackPeriod() int

func (LinRegWithoutStorage) IncDataLength

func (ind LinRegWithoutStorage) IncDataLength()

func (LinRegWithoutStorage) Length

func (ind LinRegWithoutStorage) Length() int

func (LinRegWithoutStorage) MaxValue

func (ind LinRegWithoutStorage) MaxValue() float64

func (LinRegWithoutStorage) MinValue

func (ind LinRegWithoutStorage) MinValue() float64

func (*LinRegWithoutStorage) ReceiveTick

func (ind *LinRegWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (LinRegWithoutStorage) SetValidFromBar

func (ind LinRegWithoutStorage) SetValidFromBar(streamBarIndex int)

func (LinRegWithoutStorage) UpdateMinMax

func (ind LinRegWithoutStorage) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (LinRegWithoutStorage) ValidFromBar

func (ind LinRegWithoutStorage) ValidFromBar() int

type Llv

type Llv struct {
	*LlvWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Lowest Low Value Indicator (hhv)

func NewDefaultLlv

func NewDefaultLlv() (indicator *Llv, err error)

NewDefaultLlv creates a Lowest Low Value Indicator (Llv) for online usage with default parameters

  • timePeriod: 25

func NewDefaultLlvForStream

func NewDefaultLlvForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Llv, err error)

NewDefaultLlvForStream creates a Lowest Low Value Indicator (Llv)for online usage with a source data stream

func NewDefaultLlvForStreamWithSrcLen

func NewDefaultLlvForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Llv, err error)

NewDefaultLlvForStreamWithSrcLen creates a Lowest Low Value Indicator (Llv)for offline usage with a source data stream

func NewDefaultLlvWithSrcLen

func NewDefaultLlvWithSrcLen(sourceLength uint) (indicator *Llv, err error)

NewDefaultLlvWithSrcLen creates a Lowest Low Value Indicator (Llv)for offline usage with default parameters

func NewLlv

func NewLlv(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Llv, err error)

NewLlv creates a Lowest Low Value Indicator (Llv) for online usage

func NewLlvForStream

func NewLlvForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Llv, err error)

NewLlvForStream creates a Lowest Low Value Indicator (Llv)for online usage with a source data stream

func NewLlvForStreamWithSrcLen

func NewLlvForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Llv, err error)

NewLlvForStreamWithSrcLen creates a Lowest Low Value Indicator (Llv)for offline usage with a source data stream

func NewLlvWithSrcLen

func NewLlvWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Llv, err error)

NewLlvWithSrcLen creates a Lowest Low Value Indicator (Llv)for offline usage

func (*Llv) ReceiveDOHLCVTick

func (ind *Llv) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Llv) UpdateIndicatorWithNewValue

func (ind Llv) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type LlvBars

type LlvBars struct {
	*LlvBarsWithoutStorage

	// public variables
	Data []int64
	// contains filtered or unexported fields
}

A Lowest Low Value Bars Indicator (LlvBars)

func NewDefaultLlvBars

func NewDefaultLlvBars() (indicator *LlvBars, err error)

NewDefaultLlvBars creates a Lowest Low Value Indicator (LlvBars) for online usage with default parameters

  • timePeriod: 25

func NewDefaultLlvBarsForStream

func NewDefaultLlvBarsForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LlvBars, err error)

NewDefaultLlvBarsForStream creates a Lowest Low Value Indicator (LlvBars)for online usage with a source data stream

func NewDefaultLlvBarsForStreamWithSrcLen

func NewDefaultLlvBarsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *LlvBars, err error)

NewDefaultLlvBarsForStreamWithSrcLen creates a Lowest Low Value Indicator (LlvBars)for offline usage with a source data stream

func NewDefaultLlvBarsWithSrcLen

func NewDefaultLlvBarsWithSrcLen(sourceLength uint) (indicator *LlvBars, err error)

NewDefaultLlvBarsWithSrcLen creates a Lowest Low Value Indicator (LlvBars)for offline usage with default parameters

func NewLlvBars

func NewLlvBars(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LlvBars, err error)

NewLlvBars creates a Lowest Low Value Bars Indicator (LlvBars) for online usage

func NewLlvBarsForStream

func NewLlvBarsForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LlvBars, err error)

NewLlvBarsForStream creates a Lowest Low Value Indicator (LlvBars)for online usage with a source data stream

func NewLlvBarsForStreamWithSrcLen

func NewLlvBarsForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LlvBars, err error)

NewLlvBarsForStreamWithSrcLen creates a Lowest Low Value Indicator (LlvBars)for offline usage with a source data stream

func NewLlvBarsWithSrcLen

func NewLlvBarsWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *LlvBars, err error)

NewLlvBarsWithSrcLen creates a Lowest Low Value Indicator (LlvBars)for offline usage

func (*LlvBars) ReceiveDOHLCVTick

func (ind *LlvBars) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (LlvBars) UpdateIndicatorWithNewValue

func (ind LlvBars) UpdateIndicatorWithNewValue(newValue int64, streamBarIndex int)

type LlvBarsWithoutStorage

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

A Lowest Low Value Bars Indicator (LlvBars), no storage, for use in other indicators

func NewLlvBarsWithoutStorage

func NewLlvBarsWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionInt) (indicator *LlvBarsWithoutStorage, err error)

NewLlvBarsWithoutStorage creates a Lowest Low Value Bars Indicator Indicator (LlvBars) without storage

func (*LlvBarsWithoutStorage) ReceiveTick

func (ind *LlvBarsWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (LlvBarsWithoutStorage) UpdateIndicatorWithNewValue

func (ind LlvBarsWithoutStorage) UpdateIndicatorWithNewValue(newValue int64, streamBarIndex int)

type LlvWithoutStorage

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

A Lowest Low Value Indicator (Llv), no storage, for use in other indicators

func NewLlvWithoutStorage

func NewLlvWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *LlvWithoutStorage, err error)

NewLlvWithoutStorage creates a Lowest Low Value Indicator Indicator (Llv) without storage

func (*LlvWithoutStorage) ReceiveTick

func (ind *LlvWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (LlvWithoutStorage) UpdateIndicatorWithNewValue

func (ind LlvWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Macd

type Macd struct {

	// public variables
	Macd      []float64
	Signal    []float64
	Histogram []float64
	// contains filtered or unexported fields
}

A Moving Average Convergence-Divergence (Macd) Indicator

func NewDefaultMacd

func NewDefaultMacd() (indicator *Macd, err error)

NewDefaultMacd creates a Moving Average Convergence Divergence Indicator (Macd) for online usage with default parameters

fastTimePeriod - 12
slowTimePeriod - 26
signalTimePeriod - 9

func NewDefaultMacdForStream

func NewDefaultMacdForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Macd, err error)

NewDefaultMacdForStream creates a Moving Average Convergence Divergence Indicator (Macd) for online usage with a source data stream

func NewDefaultMacdForStreamWithSrcLen

func NewDefaultMacdForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Macd, err error)

NewDefaultMacdForStreamWithSrcLen creates a Moving Average Convergence Divergence Indicator (Macd) for offline usage with a source data stream

func NewDefaultMacdWithSrcLen

func NewDefaultMacdWithSrcLen(sourceLength uint) (indicator *Macd, err error)

NewDefaultMacdWithSrcLen creates a Moving Average Convergence Divergence Indicator (Macd) for offline usage with default parameters

func NewMacd

func NewMacd(fastTimePeriod int, slowTimePeriod int, signalTimePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Macd, err error)

NewMacd creates a Moving Average Convergence Divergence Indicator (Macd) for online usage

func NewMacdForStream

func NewMacdForStream(priceStream gotrade.DOHLCVStreamSubscriber, fastTimePeriod int, slowTimePeriod int, signalTimePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Macd, err error)

NewMacdForStream creates a Moving Average Convergence Divergence Indicator (Macd) for online usage with a source data stream

func NewMacdForStreamWithSrcLen

func NewMacdForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, fastTimePeriod int, slowTimePeriod int, signalTimePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Macd, err error)

NewMacdForStreamWithSrcLen creates a Moving Average Convergence Divergence Indicator (Macd) for offline usage with a source data stream

func NewMacdWithSrcLen

func NewMacdWithSrcLen(sourceLength uint, fastTimePeriod int, slowTimePeriod int, signalTimePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Macd, err error)

NewMacdWithSrcLen creates a Moving Average Convergence Divergence Indicator (Macd) for offline usage

func (Macd) GetLookbackPeriod

func (ind Macd) GetLookbackPeriod() int

func (Macd) IncDataLength

func (ind Macd) IncDataLength()

func (Macd) Length

func (ind Macd) Length() int

func (Macd) MaxValue

func (ind Macd) MaxValue() float64

func (Macd) MinValue

func (ind Macd) MinValue() float64

func (*Macd) ReceiveDOHLCVTick

func (ind *Macd) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (*Macd) ReceiveTick

func (ind *Macd) ReceiveTick(tickData float64, streamBarIndex int)

func (Macd) SetValidFromBar

func (ind Macd) SetValidFromBar(streamBarIndex int)

func (Macd) UpdateMinMax

func (ind Macd) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (Macd) ValidFromBar

func (ind Macd) ValidFromBar() int

type MedPrice

type MedPrice struct {
	*MedPriceWithoutStorage

	// public variables
	Data []float64
}

A Median Price Indicator (MedPrice)

func NewMedPrice

func NewMedPrice() (indicator *MedPrice, err error)

func NewMedPriceForStream

func NewMedPriceForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MedPrice, err error)

NewMedPriceForStream creates a Median Price Indicator (MedPrice) for online usage with a source data stream

func NewMedPriceForStreamWithSrcLen

func NewMedPriceForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MedPrice, err error)

NewMedPriceForStreamWithSrcLen creates a Median Price Indicator (MedPrice) for offline usage with a source data stream

func NewMedPriceWithSrcLen

func NewMedPriceWithSrcLen(sourceLength uint) (indicator *MedPrice, err error)

NewMedPriceWithSrcLen creates a Median Price Indicator (MedPrice) for offline usage

func (MedPrice) UpdateIndicatorWithNewValue

func (ind MedPrice) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MedPriceWithoutStorage

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

A Median Price Indicator (MedPrice), no storage, for use in other indicators

func NewMedPriceWithoutStorage

func NewMedPriceWithoutStorage(valueAvailableAction ValueAvailableActionFloat) (indicator *MedPriceWithoutStorage, err error)

NewMedPriceWithoutStorage creates a Median Price Indicator (MedPrice) without storage

func (*MedPriceWithoutStorage) ReceiveDOHLCVTick

func (ind *MedPriceWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (MedPriceWithoutStorage) UpdateIndicatorWithNewValue

func (ind MedPriceWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Mfi

type Mfi struct {
	*MfiWithoutStorage

	// public variables
	Data []float64
}

A Money Flow Index Indicator (Mfi)

func NewDefaultMfi

func NewDefaultMfi() (indicator *Mfi, err error)

NewDefaultMfi creates a Money Flow Index Indicator (Mfi) for online usage with default parameters

  • timePeriod: 25

func NewDefaultMfiForStream

func NewDefaultMfiForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Mfi, err error)

NewDefaultMfiForStream creates a Money Flow Index Indicator (Mfi) for online usage with a source data stream

func NewDefaultMfiForStreamWithSrcLen

func NewDefaultMfiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Mfi, err error)

NewDefaultMfiForStreamWithSrcLen creates a Money Flow Index Indicator (Mfi) for offline usage with a source data stream

func NewDefaultMfiWithSrcLen

func NewDefaultMfiWithSrcLen(sourceLength uint) (indicator *Mfi, err error)

NewDefaultMfiWithSrcLen creates a Money Flow Index Indicator (Mfi) for offline usage with default parameters

func NewMfi

func NewMfi(timePeriod int) (indicator *Mfi, err error)

NewMfi creates a Money Flow Index Indicator (Mfi) for online usage

func NewMfiForStream

func NewMfiForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Mfi, err error)

NewMfiForStream creates a Money Flow Index Indicator (Mfi) for online usage with a source data stream

func NewMfiForStreamWithSrcLen

func NewMfiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *Mfi, err error)

NewMfiForStreamWithSrcLen creates a Money Flow Index Indicator (Mfi) for offline usage with a source data stream

func NewMfiWithSrcLen

func NewMfiWithSrcLen(sourceLength uint, timePeriod int) (indicator *Mfi, err error)

NewMfiWithSrcLen creates a Money Flow Index Indicator (Mfi) for offline usage

func (Mfi) UpdateIndicatorWithNewValue

func (ind Mfi) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MfiWithoutStorage

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

A Money Flow Index Indicator (Mfi), no storage, for use in other indicators

func NewMfiWithoutStorage

func NewMfiWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *MfiWithoutStorage, err error)

NewMfiWithoutStorage creates a Money Flow Index Indicator (Mfi) without storage

func (*MfiWithoutStorage) ReceiveDOHLCVTick

func (ind *MfiWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (MfiWithoutStorage) UpdateIndicatorWithNewValue

func (ind MfiWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MinusDi

type MinusDi struct {
	*MinusDiWithoutStorage

	// public variables
	Data []float64
}

A Minus Directional Indicator (MinusDi)

func NewDefaultMinusDi

func NewDefaultMinusDi() (indicator *MinusDi, err error)

NewDefaultMinusDi creates a Minus Directional Indicator (MinusDi) for online usage with default parameters

  • timePeriod: 14

func NewDefaultMinusDiForStream

func NewDefaultMinusDiForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MinusDi, err error)

NewDefaultMinusDiForStream creates a Minus Directional Indicator (MinusDi) for online usage with a source data stream

func NewDefaultMinusDiForStreamWithSrcLen

func NewDefaultMinusDiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MinusDi, err error)

NewDefaultMinusDiForStreamWithSrcLen creates a Minus Directional Indicator (MinusDi) for offline usage with a source data stream

func NewDefaultMinusDiWithSrcLen

func NewDefaultMinusDiWithSrcLen(sourceLength uint) (indicator *MinusDi, err error)

NewDefaultMinusDiWithSrcLen creates a Minus Directional Indicator (MinusDi) for offline usage with default parameters

func NewMinusDi

func NewMinusDi(timePeriod int) (indicator *MinusDi, err error)

NewMinusDi creates a Minus Directional Indicator (MinusDi) for online usage

func NewMinusDiForStream

func NewMinusDiForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *MinusDi, err error)

NewMinusDiForStream creates a Minus Directional Indicator (MinusDi) for online usage with a source data stream

func NewMinusDiForStreamWithSrcLen

func NewMinusDiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *MinusDi, err error)

NewMinusDiForStreamWithSrcLen creates a Minus Directional Indicator (MinusDi) for offline usage with a source data stream

func NewMinusDiWithSrcLen

func NewMinusDiWithSrcLen(sourceLength uint, timePeriod int) (indicator *MinusDi, err error)

NewMinusDiWithSrcLen creates a Minus Directional Indicator (MinusDi) for offline usage

func (MinusDi) UpdateIndicatorWithNewValue

func (ind MinusDi) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MinusDiWithoutStorage

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

A Minus Directional Indicator (MinusDi), no storage, for use in other indicators

func NewMinusDiWithoutStorage

func NewMinusDiWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *MinusDiWithoutStorage, err error)

NewMinusDiWithoutStorage creates a Minus Directional Indicator (MinusDi) without storage

func (*MinusDiWithoutStorage) ReceiveDOHLCVTick

func (ind *MinusDiWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (MinusDiWithoutStorage) UpdateIndicatorWithNewValue

func (ind MinusDiWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MinusDm

type MinusDm struct {
	*MinusDmWithoutStorage

	// public variables
	Data []float64
}

A Minus Directional Movement Indicator (MinusDm)

func NewDefaultMinusDm

func NewDefaultMinusDm() (indicator *MinusDm, err error)

NewDefaultMinusDm creates a Minus Directional Movement Indicator (MinusDm) for online usage with default parameters

  • timePeriod: 14

func NewDefaultMinusDmForStream

func NewDefaultMinusDmForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MinusDm, err error)

NewDefaultMinusDmForStream creates a Minus Directional Movement Indicator (MinusDm) for online usage with a source data stream

func NewDefaultMinusDmForStreamWithSrcLen

func NewDefaultMinusDmForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *MinusDm, err error)

NewDefaultMinusDmForStreamWithSrcLen creates a Minus Directional Movement Indicator (MinusDm) for offline usage with a source data stream

func NewDefaultMinusDmWithSrcLen

func NewDefaultMinusDmWithSrcLen(sourceLength uint) (indicator *MinusDm, err error)

NewDefaultMinusDmWithSrcLen creates a Minus Directional Movement Indicator (MinusDm) for offline usage with default parameters

func NewMinusDm

func NewMinusDm(timePeriod int) (indicator *MinusDm, err error)

NewMinusDm creates a Minus Directional Movement Indicator (MinusDm) for online usage

func NewMinusDmForStream

func NewMinusDmForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *MinusDm, err error)

NewMinusDmForStream creates a Minus Directional Movement Indicator (MinusDm) for online usage with a source data stream

func NewMinusDmForStreamWithSrcLen

func NewMinusDmForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *MinusDm, err error)

NewMinusDmForStreamWithSrcLen creates a Minus Directional Movement Indicator (MinusDm) for offline usage with a source data stream

func NewMinusDmWithSrcLen

func NewMinusDmWithSrcLen(sourceLength uint, timePeriod int) (indicator *MinusDm, err error)

NewMinusDmWithSrcLen creates a Minus Directional Movement Indicator (MinusDm) for offline usage

func (MinusDm) UpdateIndicatorWithNewValue

func (ind MinusDm) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MinusDmWithoutStorage

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

A Minus Directional Movement Indicator (MinusDm), no storage, for use in other indicators

func NewMinusDmWithoutStorage

func NewMinusDmWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *MinusDmWithoutStorage, err error)

NewMinusDmWithoutStorage creates a Minus Directional Movement Indicator (MinusDm) without storage

func (*MinusDmWithoutStorage) ReceiveDOHLCVTick

func (ind *MinusDmWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (MinusDmWithoutStorage) UpdateIndicatorWithNewValue

func (ind MinusDmWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Mom

type Mom struct {
	*MomWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Momentum Indicator (Mom)

func NewDefaultMom

func NewDefaultMom() (indicator *Mom, err error)

NewDefaultMom creates a Momentum (Mom) for online usage with default parameters

  • timePeriod: 10
  • selectData: useClosePrice

func NewDefaultMomForStream

func NewDefaultMomForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Mom, err error)

NewDefaultMomForStream creates a Momentum (Mom) for online usage with a source data stream

func NewDefaultMomForStreamWithSrcLen

func NewDefaultMomForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Mom, err error)

NewDefaultMomForStreamWithSrcLen creates a Momentum (Mom) for offline usage with a source data stream

func NewDefaultMomWithSrcLen

func NewDefaultMomWithSrcLen(sourceLength uint) (indicator *Mom, err error)

NewDefaultMomWithSrcLen creates a Momentum (Mom) for offline usage with default parameters

func NewMom

func NewMom(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Mom, err error)

NewMom creates a Momentum (Mom) for online usage

func NewMomForStream

func NewMomForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Mom, err error)

NewMomForStream creates a Momentum (Mom) for online usage with a source data stream

func NewMomForStreamWithSrcLen

func NewMomForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Mom, err error)

NewMomForStreamWithSrcLen creates a Momentum (Mom) for offline usage with a source data stream

func NewMomWithSrcLen

func NewMomWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Mom, err error)

NewMomWithSrcLen creates a Momentum (Mom) for offline usage

func (*Mom) ReceiveDOHLCVTick

func (ind *Mom) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Mom) UpdateIndicatorWithNewValue

func (ind Mom) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type MomWithoutStorage

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

A Momentum Indicator (Mom), no storage, for use in other indicators

func NewMomWithoutStorage

func NewMomWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *MomWithoutStorage, err error)

NewMomWithoutStorage creates a Momentum Indicator (Mom) without storage

func (*MomWithoutStorage) ReceiveTick

func (ind *MomWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (MomWithoutStorage) UpdateIndicatorWithNewValue

func (ind MomWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Obv

type Obv struct {
	*ObvWithoutStorage

	// public variables
	Data []float64
}

A On Balance Volume Indicator (Obv)

func NewObv

func NewObv() (indicator *Obv, err error)

NewObv creates an On Balance Volume Indicator (Obv) for online usage

func NewObvForStream

func NewObvForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Obv, err error)

NewObvForStream creates an On Balance Volume (Obv) for online usage with a source data stream

func NewObvForStreamWithSrcLen

func NewObvForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Obv, err error)

NewObvForStreamWithSrcLen creates an On Balance Volume (Obv) for offline usage with a source data stream

func NewObvWithSrcLen

func NewObvWithSrcLen(sourceLength uint) (indicator *Obv, err error)

NewObvWithSrcLen creates an On Balance Volume (Obv) for offline usage

func (Obv) UpdateIndicatorWithNewValue

func (ind Obv) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type ObvWithoutStorage

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

An On Balance Volume Indicator (Obv), no storage, for use in other indicators

func NewObvWithoutStorage

func NewObvWithoutStorage(valueAvailableAction ValueAvailableActionFloat) (indicator *ObvWithoutStorage, err error)

NewObvWithoutStorage creates an On Balance Volume Indicator (Obv) without storage

func (*ObvWithoutStorage) ReceiveDOHLCVTick

func (ind *ObvWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (ObvWithoutStorage) UpdateIndicatorWithNewValue

func (ind ObvWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type PlusDi

type PlusDi struct {
	*PlusDiWithoutStorage

	// public variables
	Data []float64
}

A Plus Directional Indicator (PlusDi)

func NewDefaultPlusDi

func NewDefaultPlusDi() (indicator *PlusDi, err error)

NewDefaultPlusDi creates a Plus Directional Indicator (PlusDi) for online usage with default parameters

  • timePeriod: 14

func NewDefaultPlusDiForStream

func NewDefaultPlusDiForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *PlusDi, err error)

NewDefaultPlusDiForStream creates a Plus Directional Indicator (PlusDi) for online usage with a source data stream

func NewDefaultPlusDiForStreamWithSrcLen

func NewDefaultPlusDiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *PlusDi, err error)

NewDefaultPlusDiForStreamWithSrcLen creates a Plus Directional Indicator (PlusDi) for offline usage with a source data stream

func NewDefaultPlusDiWithSrcLen

func NewDefaultPlusDiWithSrcLen(sourceLength uint) (indicator *PlusDi, err error)

NewDefaultPlusDiWithSrcLen creates a Plus Directional Indicator (PlusDi) for offline usage with default parameters

func NewPlusDi

func NewPlusDi(timePeriod int) (indicator *PlusDi, err error)

NewPlusDi creates a Plus Directional Indicator (PlusDi) for online usage

func NewPlusDiForStream

func NewPlusDiForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *PlusDi, err error)

NewPlusDiForStream creates a Plus Directional Indicator (PlusDi) for online usage with a source data stream

func NewPlusDiForStreamWithSrcLen

func NewPlusDiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *PlusDi, err error)

NewPlusDiForStreamWithSrcLen creates a Plus Directional Indicator (PlusDi) for offline usage with a source data stream

func NewPlusDiWithSrcLen

func NewPlusDiWithSrcLen(sourceLength uint, timePeriod int) (indicator *PlusDi, err error)

NewPlusDiWithSrcLen creates a Plus Directional Indicator (PlusDi) for offline usage

func (PlusDi) UpdateIndicatorWithNewValue

func (ind PlusDi) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type PlusDiWithoutStorage

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

A Plus Directional Indicator (PlusDi), no storage, for use in other indicators

func NewPlusDiWithoutStorage

func NewPlusDiWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *PlusDiWithoutStorage, err error)

NewPlusDiWithoutStorage creates a Plus Directional Indicator (PlusDi) without storage

func (*PlusDiWithoutStorage) ReceiveDOHLCVTick

func (ind *PlusDiWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (PlusDiWithoutStorage) UpdateIndicatorWithNewValue

func (ind PlusDiWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type PlusDm

type PlusDm struct {
	*PlusDmWithoutStorage

	// public variables
	Data []float64
}

A Plus Directional Movement Indicator (PlusDm)

func NewDefaultPlusDm

func NewDefaultPlusDm() (indicator *PlusDm, err error)

NewDefaultPlusDm creates a Plus Directional Movement Indicator (PlusDm) for online usage with default parameters

  • timePeriod: 14

func NewDefaultPlusDmForStream

func NewDefaultPlusDmForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *PlusDm, err error)

NewDefaultPlusDmForStream creates a Plus Directional Movement Indicator (PlusDm) for online usage with a source data stream

func NewDefaultPlusDmForStreamWithSrcLen

func NewDefaultPlusDmForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *PlusDm, err error)

NewDefaultPlusDmForStreamWithSrcLen creates a Plus Directional Movement Indicator (PlusDm) for offline usage with a source data stream

func NewDefaultPlusDmWithSrcLen

func NewDefaultPlusDmWithSrcLen(sourceLength uint) (indicator *PlusDm, err error)

NewDefaultPlusDmWithSrcLen creates a Plus Directional Movement Indicator (PlusDm) for offline usage with default parameters

func NewPlusDm

func NewPlusDm(timePeriod int) (indicator *PlusDm, err error)

NewPlusDm creates a Plus Directional Movement Indicator (PlusDm) for online usage

func NewPlusDmForStream

func NewPlusDmForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *PlusDm, err error)

NewPlusDmForStream creates a Plus Directional Movement Indicator (PlusDm) for online usage with a source data stream

func NewPlusDmForStreamWithSrcLen

func NewPlusDmForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *PlusDm, err error)

NewPlusDmForStreamWithSrcLen creates a Plus Directional Movement Indicator (PlusDm) for offline usage with a source data stream

func NewPlusDmWithSrcLen

func NewPlusDmWithSrcLen(sourceLength uint, timePeriod int) (indicator *PlusDm, err error)

NewPlusDmWithSrcLen creates a Plus Directional Movement Indicator (PlusDm) for offline usage

func (PlusDm) UpdateIndicatorWithNewValue

func (ind PlusDm) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type PlusDmWithoutStorage

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

A Plus Directional Movement Indicator (PlusDm), no storage, for use in other indicators

func NewPlusDmWithoutStorage

func NewPlusDmWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *PlusDmWithoutStorage, err error)

NewPlusDmWithoutStorage creates a Plus Directional Movement Indicator (PlusDm) without storage

func (*PlusDmWithoutStorage) ReceiveDOHLCVTick

func (ind *PlusDmWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (PlusDmWithoutStorage) UpdateIndicatorWithNewValue

func (ind PlusDmWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Roc

type Roc struct {
	*RocWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Rate of Change Indicator (Roc)

func NewDefaultRoc

func NewDefaultRoc() (indicator *Roc, err error)

NewDefaultRoc creates a Rate of Change Indicator (Roc) for online usage with default parameters

  • timePeriod: 10

func NewDefaultRocForStream

func NewDefaultRocForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Roc, err error)

NewDefaultRocForStream creates a Rate of Change Indicator (Roc) for online usage with a source data stream

func NewDefaultRocForStreamWithSrcLen

func NewDefaultRocForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Roc, err error)

NewDefaultRocForStreamWithSrcLen creates a Rate of Change Indicator (Roc) for offline usage with a source data stream

func NewDefaultRocWithSrcLen

func NewDefaultRocWithSrcLen(sourceLength uint) (indicator *Roc, err error)

NewDefaultRocWithSrcLen creates a Rate of Change Indicator (Roc) for offline usage with default parameters

func NewRoc

func NewRoc(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Roc, err error)

NewRoc creates a Rate of Change Indicator (Roc) for online usage

func NewRocForStream

func NewRocForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Roc, err error)

NewRocForStream creates a Rate of Change Indicator (Roc) for online usage with a source data stream

func NewRocForStreamWithSrcLen

func NewRocForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Roc, err error)

NewRocForStreamWithSrcLen creates a Rate of Change Indicator (Roc) for offline usage with a source data stream

func NewRocWithSrcLen

func NewRocWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Roc, err error)

NewRocWithSrcLen creates a Rate of Change Indicator (Roc) for offline usage

func (*Roc) ReceiveDOHLCVTick

func (ind *Roc) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Roc) UpdateIndicatorWithNewValue

func (ind Roc) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocP

type RocP struct {
	*RocPWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Rate of Change Percentage Indicator (RocP)

func NewDefaultRocP

func NewDefaultRocP() (indicator *RocP, err error)

NewDefaultRocP creates a Rate of Change Percentage Indicator (RocP) for online usage with default parameters

  • timePeriod: 10

func NewDefaultRocPForStream

func NewDefaultRocPForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocP, err error)

NewDefaultRocPForStream creates a Rate of Change Percentage Indicator (RocP) for online usage with a source data stream

func NewDefaultRocPForStreamWithSrcLen

func NewDefaultRocPForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocP, err error)

NewDefaultRocPForStreamWithSrcLen creates a Rate of Change Percentage Indicator (RocP) for offline usage with a source data stream

func NewDefaultRocPWithSrcLen

func NewDefaultRocPWithSrcLen(sourceLength uint) (indicator *RocP, err error)

NewDefaultRocPWithSrcLen creates a Rate of Change Percentage Indicator (RocP) for offline usage with default parameters

func NewRocP

func NewRocP(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocP, err error)

NewRocP creates a Rate of Change Percentage Indicator (RocP) for online usage

func NewRocPForStream

func NewRocPForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocP, err error)

NewRocPForStream creates a Rate of Change Percentage Indicator (RocP) for online usage with a source data stream

func NewRocPForStreamWithSrcLen

func NewRocPForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocP, err error)

NewRocPForStreamWithSrcLen creates a Rate of Change Percentage Indicator (RocP) for offline usage with a source data stream

func NewRocPWithSrcLen

func NewRocPWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocP, err error)

NewRocPWithSrcLen creates a Rate of Change Percentage Indicator (RocP) for offline usage

func (*RocP) ReceiveDOHLCVTick

func (ind *RocP) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (RocP) UpdateIndicatorWithNewValue

func (ind RocP) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocPWithoutStorage

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

A Rate of Change Percentage Indicator (RocP), no storage, for use in other indicators

func NewRocPWithoutStorage

func NewRocPWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *RocPWithoutStorage, err error)

NewRocPWithoutStorage creates a Rate of Change Percentage Indicator (RocP) without storage

func (*RocPWithoutStorage) ReceiveTick

func (ind *RocPWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (RocPWithoutStorage) UpdateIndicatorWithNewValue

func (ind RocPWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocR

type RocR struct {
	*RocRWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Rate of Change Ratio Indicator (RocR)

func NewDefaultRocR

func NewDefaultRocR() (indicator *RocR, err error)

NewDefaultRocR creates a Rate of Change Ratio Indicator (RocR) for online usage with default parameters

  • timePeriod: 10

func NewDefaultRocRForStream

func NewDefaultRocRForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocR, err error)

NewDefaultRocRForStream creates a Rate of Change Ratio Indicator (RocR) for online usage with a source data stream

func NewDefaultRocRForStreamWithSrcLen

func NewDefaultRocRForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocR, err error)

NewDefaultRocRForStreamWithSrcLen creates a Rate of Change Ratio Indicator (RocR) for offline usage with a source data stream

func NewDefaultRocRWithSrcLen

func NewDefaultRocRWithSrcLen(sourceLength uint) (indicator *RocR, err error)

NewDefaultRocRWithSrcLen creates a Rate of Change Ratio Indicator (RocR) for offline usage with default parameters

func NewRocR

func NewRocR(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR, err error)

NewRocR creates a Rate of Change Ratio Indicator (RocR) for online usage

func NewRocRForStream

func NewRocRForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR, err error)

NewRocRForStream creates a Rate of Change Ratio Indicator (RocR) for online usage with a source data stream

func NewRocRForStreamWithSrcLen

func NewRocRForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR, err error)

NewRocRForStreamWithSrcLen creates a Rate of Change Ratio Indicator (RocR) for offline usage with a source data stream

func NewRocRWithSrcLen

func NewRocRWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR, err error)

NewRocRWithSrcLen creates a Rate of Change Ratio Indicator (RocR) for offline usage

func (*RocR) ReceiveDOHLCVTick

func (ind *RocR) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (RocR) UpdateIndicatorWithNewValue

func (ind RocR) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocR100

type RocR100 struct {
	*RocR100WithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Rate of Change Ratio Indicator (RocR)

func NewDefaultRocR100

func NewDefaultRocR100() (indicator *RocR100, err error)

/ NewDefaultRocR100 creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for online usage with default parameters

  • timePeriod: 10

func NewDefaultRocR100ForStream

func NewDefaultRocR100ForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocR100, err error)

NewDefaultRocR100ForStream creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for online usage with a source data stream

func NewDefaultRocR100ForStreamWithSrcLen

func NewDefaultRocR100ForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *RocR100, err error)

NewDefaultRocR100ForStreamWithSrcLen creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for offline usage with a source data stream

func NewDefaultRocR100WithSrcLen

func NewDefaultRocR100WithSrcLen(sourceLength uint) (indicator *RocR100, err error)

NewDefaultRocR100WithSrcLen creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for offline usage with default parameters

func NewRocR100

func NewRocR100(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR100, err error)

NewRocR100 creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for online usage

func NewRocR100ForStream

func NewRocR100ForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR100, err error)

NewRocR100ForStream creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for online usage with a source data stream

func NewRocR100ForStreamWithSrcLen

func NewRocR100ForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR100, err error)

NewRocR100ForStreamWithSrcLen creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for offline usage with a source data stream

func NewRocR100WithSrcLen

func NewRocR100WithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *RocR100, err error)

NewRocR100WithSrcLen creates a Rate of Change Ratio 100 Scale Indicator (RocR100) for offline usage

func (*RocR100) ReceiveDOHLCVTick

func (ind *RocR100) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (RocR100) UpdateIndicatorWithNewValue

func (ind RocR100) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocR100WithoutStorage

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

A Rate of Change Ratio 100 Scale Indicator (RocR100), no storage, for use in other indicators

func NewRocR100WithoutStorage

func NewRocR100WithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *RocR100WithoutStorage, err error)

NewRocR100WithoutStorage creates a Rate of Change Ratio 100 Scale Indicator (RocR100) without storage

func (*RocR100WithoutStorage) ReceiveTick

func (ind *RocR100WithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (RocR100WithoutStorage) UpdateIndicatorWithNewValue

func (ind RocR100WithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocRWithoutStorage

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

A Rate of Change Ratio Indicator (RocR), no storage, for use in other indicators

func NewRocRWithoutStorage

func NewRocRWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *RocRWithoutStorage, err error)

NewRocRWithoutStorage creates a Rate of Change Ratio Indicator (RocR) without storage

func (*RocRWithoutStorage) ReceiveTick

func (ind *RocRWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (RocRWithoutStorage) UpdateIndicatorWithNewValue

func (ind RocRWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RocWithoutStorage

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

A Rate of Change Indicator (Roc), no storage, for use in other indicators

func NewRocWithoutStorage

func NewRocWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *RocWithoutStorage, err error)

NewRocWithoutStorage creates a Rate of Change Indicator (Roc) without storage

func (*RocWithoutStorage) ReceiveTick

func (ind *RocWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (RocWithoutStorage) UpdateIndicatorWithNewValue

func (ind RocWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Rsi

type Rsi struct {
	*RsiWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Relative Strength Indicator (Rsi)

func NewDefaultRsi

func NewDefaultRsi() (indicator *Rsi, err error)

NewDefaultRsi creates a Relative Strength Indicator (Rsi) for online usage with default parameters

  • timePeriod: 14

func NewDefaultRsiForStream

func NewDefaultRsiForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Rsi, err error)

NewDefaultRsiForStream creates a Relative Strength Indicator (Rsi) for online usage with a source data stream

func NewDefaultRsiForStreamWithSrcLen

func NewDefaultRsiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Rsi, err error)

NewDefaultRsiForStreamWithSrcLen creates a Relative Strength Indicator (Rsi) for offline usage with a source data stream

func NewDefaultRsiWithSrcLen

func NewDefaultRsiWithSrcLen(sourceLength uint) (indicator *Rsi, err error)

NewDefaultRsiWithSrcLen creates a Relative Strength Indicator (Rsi) for offline usage with default parameters

func NewRsi

func NewRsi(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Rsi, err error)

NewRsi creates a Relative Strength Indicator (Rsi) for online usage

func NewRsiForStream

func NewRsiForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Rsi, err error)

NewRsiForStream creates a Relative Strength Indicator (Rsi) for online usage with a source data stream

func NewRsiForStreamWithSrcLen

func NewRsiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Rsi, err error)

NewRsiForStreamWithSrcLen creates a Relative Strength Indicator (Rsi) for offline usage with a source data stream

func NewRsiWithSrcLen

func NewRsiWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Rsi, err error)

NewRsiWithSrcLen creates a Relative Strength Indicator (Rsi) for offline usage

func (*Rsi) ReceiveDOHLCVTick

func (ind *Rsi) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Rsi) UpdateIndicatorWithNewValue

func (ind Rsi) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type RsiWithoutStorage

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

A Relative Strength Indicator (Rsi), no storage, for use in other indicators

func NewRsiWithoutStorage

func NewRsiWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *RsiWithoutStorage, err error)

NewRsiWithoutStorage creates a Relative Strength Indicator (Rsi) without storage

func (*RsiWithoutStorage) ReceiveTick

func (ind *RsiWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (RsiWithoutStorage) UpdateIndicatorWithNewValue

func (ind RsiWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Sar

type Sar struct {
	*SarWithoutStorage

	// public variables
	Data []float64
}

A Stop and Reverse Indicator (Sar)

func NewDefaultSar

func NewDefaultSar() (indicator *Sar, err error)

NewDefaultSar creates a Stop and Reverse Indicator (Sar) for online usage with default parameters

  • accelerationFactor: 0.02
  • accelerationFactorMax: 0.2

func NewDefaultSarForStream

func NewDefaultSarForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Sar, err error)

NewDefaultSarForStream creates a Stop and Reverse Indicator (Sar) for online usage with a source data stream

func NewDefaultSarForStreamWithSrcLen

func NewDefaultSarForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Sar, err error)

NewDefaultSarForStreamWithSrcLen creates a Stop and Reverse Indicator (Sar) for offline usage with a source data stream

func NewDefaultSarWithSrcLen

func NewDefaultSarWithSrcLen(sourceLength uint) (indicator *Sar, err error)

NewDefaultSarWithSrcLen creates a Stop and Reverse Indicator (Sar) for offline usage with default parameters

func NewSar

func NewSar(accelerationFactor float64, accelerationFactorMax float64) (indicator *Sar, err error)

NewSar creates a Stop and Reverse Indicator (Sar) for online usage

func NewSarForStream

func NewSarForStream(priceStream gotrade.DOHLCVStreamSubscriber, accelerationFactor float64, accelerationFactorMax float64) (indicator *Sar, err error)

NewSarForStream creates a Stop and Reverse Indicator (Sar) for online usage with a source data stream

func NewSarForStreamWithSrcLen

func NewSarForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, accelerationFactor float64, accelerationFactorMax float64) (indicator *Sar, err error)

NewSarForStreamWithSrcLen creates a Stop and Reverse Indicator (Sar) for offline usage with a source data stream

func NewSarWithSrcLen

func NewSarWithSrcLen(sourceLength uint, accelerationFactor float64, accelerationFactorMax float64) (indicator *Sar, err error)

NewSarWithSrcLen creates a Stop and Reverse Indicator (Sar) for offline usage

func (Sar) UpdateIndicatorWithNewValue

func (ind Sar) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type SarWithoutStorage

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

A Stop and Reverse Indicator (Sar), no storage, for use in other indicators

func NewSarWithoutStorage

func NewSarWithoutStorage(accelerationFactor float64, accelerationFactorMax float64, valueAvailableAction ValueAvailableActionFloat) (indicator *SarWithoutStorage, err error)

func (*SarWithoutStorage) ReceiveDOHLCVTick

func (ind *SarWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (SarWithoutStorage) UpdateIndicatorWithNewValue

func (ind SarWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Sma

type Sma struct {
	*SmaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Simple Moving Average Indicator (Sma)

func NewDefaultSma

func NewDefaultSma() (indicator *Sma, err error)

NewDefaultSma creates a Simple Moving Average Indicator (Sma) for online usage with default parameters

  • timePeriod: 10

func NewDefaultSmaForStream

func NewDefaultSmaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Sma, err error)

NewDefaultSmaForStream creates a Simple Moving Average Indicator (Sma) for online usage with a source data stream

func NewDefaultSmaForStreamWithSrcLen

func NewDefaultSmaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Sma, err error)

NewDefaultSmaForStreamWithSrcLen creates a Simple Moving Average Indicator (Sma) for offline usage with a source data stream

func NewDefaultSmaWithSrcLen

func NewDefaultSmaWithSrcLen(sourceLength uint) (indicator *Sma, err error)

NewDefaultSmaWithSrcLen creates a Simple Moving Average Indicator (Sma) for offline usage with default parameters

func NewSma

func NewSma(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Sma, err error)

NewSma creates a Simple Moving Average Indicator (Sma) for online usage

func NewSmaForStream

func NewSmaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Sma, err error)

NewSmaForStream creates a Simple Moving Average Indicator (Sma) for online usage with a source data stream

func NewSmaForStreamWithSrcLen

func NewSmaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Sma, err error)

NewSmaForStreamWithSrcLen creates a Simple Moving Average Indicator (Sma) for offline usage with a source data stream

func NewSmaWithSrcLen

func NewSmaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Sma, err error)

NewSmaWithSrcLen creates a Simple Moving Average Indicator (Sma) for offline usage

func (*Sma) ReceiveDOHLCVTick

func (ind *Sma) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Sma) UpdateIndicatorWithNewValue

func (ind Sma) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type SmaWithoutStorage

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

A Simple Moving Average Indicator (Sma), no storage, for use in other indicators

func NewSmaWithoutStorage

func NewSmaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *SmaWithoutStorage, err error)

NewSmaWithoutStorage creates a Simple Moving Average Indicator (Sma) without storage

func (*SmaWithoutStorage) ReceiveTick

func (ind *SmaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (SmaWithoutStorage) UpdateIndicatorWithNewValue

func (ind SmaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type StdDev

type StdDev struct {
	*StdDevWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Standard Deviation Indicator (StdDev)

func NewDefaultStdDev

func NewDefaultStdDev() (indicator *StdDev, err error)

NewDefaultStdDev creates a Standard Deviation Indicator (StdDev) for online usage with default parameters

  • timePeriod: 10

func NewDefaultStdDevForStream

func NewDefaultStdDevForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StdDev, err error)

NewDefaultStdDevForStream creates a Standard Deviation Indicator (StdDev) for online usage with a source data stream

func NewDefaultStdDevForStreamWithSrcLen

func NewDefaultStdDevForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StdDev, err error)

NewDefaultStdDevForStreamWithSrcLen creates a Standard Deviation Indicator (StdDev) for offline usage with a source data stream

func NewDefaultStdDevWithSrcLen

func NewDefaultStdDevWithSrcLen(sourceLength uint) (indicator *StdDev, err error)

NewDefaultStdDevWithSrcLen creates a Standard Deviation Indicator (StdDev) for offline usage with default parameters

func NewStdDev

func NewStdDev(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *StdDev, err error)

NewStdDev creates a Standard Deviation Indicator (StdDev) for online usage

func NewStdDevForStream

func NewStdDevForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *StdDev, err error)

NewStdDevForStream creates a Standard Deviation Indicator (StdDev) for online usage with a source data stream

func NewStdDevForStreamWithSrcLen

func NewStdDevForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *StdDev, err error)

NewStdDevForStreamWithSrcLen creates a Standard Deviation Indicator (StdDev) for offline usage with a source data stream

func NewStdDevWithSrcLen

func NewStdDevWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *StdDev, err error)

NewStdDevWithSrcLen creates a Standard Deviation Indicator (StdDev) for offline usage

func (*StdDev) ReceiveDOHLCVTick

func (stdDev *StdDev) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (StdDev) UpdateIndicatorWithNewValue

func (ind StdDev) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type StdDevWithoutStorage

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

A Standard Deviation Indicator (StdDev), no storage, for use in other indicators

func NewStdDevWithoutStorage

func NewStdDevWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *StdDevWithoutStorage, err error)

func (*StdDevWithoutStorage) ReceiveTick

func (stdDev *StdDevWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (StdDevWithoutStorage) UpdateIndicatorWithNewValue

func (ind StdDevWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type StochOsc

type StochOsc struct {
	*StochOscWithoutStorage

	// public variables
	SlowK []float64
	SlowD []float64
}

A Stochastic Oscillator Indicator (StochOsc)

func NewDefaultStochOsc

func NewDefaultStochOsc() (indicator *StochOsc, err error)

NewDefaultStochOsc creates a Stochastic Oscillator Indicator (StochOsc) for online usage with default parameters

  • fastKTimePeriod : 5
  • slowKTimePeriod : 3
  • slowDTimePeriod : 3

func NewDefaultStochOscForStream

func NewDefaultStochOscForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StochOsc, err error)

NewDefaultStochOscForStream creates a Stochastic Oscillator Indicator (StochOsc) for online usage with a source data stream

func NewDefaultStochOscForStreamWithSrcLen

func NewDefaultStochOscForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StochOsc, err error)

NewDefaultStochOscForStreamWithSrcLen creates a Stochastic Oscillator Indicator (StochOsc) for offline usage with a source data stream

func NewDefaultStochOscWithSrcLen

func NewDefaultStochOscWithSrcLen(sourceLength uint) (indicator *StochOsc, err error)

NewDefaultStochOscWithSrcLen creates a Stochastic Oscillator Indicator (StochOsc) for offline usage with default parameters

func NewStochOsc

func NewStochOsc(fastKTimePeriod int, slowKTimePeriod int, slowDTimePeriod int) (indicator *StochOsc, err error)

NewStochOsc creates a Stochastic Oscillator Indicator (StochOsc) for online usage

func NewStochOscForStream

func NewStochOscForStream(priceStream gotrade.DOHLCVStreamSubscriber, fastKTimePeriod int, slowKTimePeriod int, slowDTimePeriod int) (indicator *StochOsc, err error)

NewStochOscForStream creates a Stochastic Oscillator Indicator (StochOsc) for online usage with a source data stream

func NewStochOscForStreamWithSrcLen

func NewStochOscForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, fastKTimePeriod int, slowKTimePeriod int, slowDTimePeriod int) (indicator *StochOsc, err error)

NewStochOscForStreamWithSrcLen creates a Stochastic Oscillator Indicator (StochOsc) for offline usage with a source data stream

func NewStochOscWithSrcLen

func NewStochOscWithSrcLen(sourceLength uint, fastKTimePeriod int, slowKTimePeriod int, slowDTimePeriod int) (indicator *StochOsc, err error)

NewStochOscWithSrcLen creates a Stochastic Oscillator Indicator (StochOsc) for offline usage

func (StochOsc) UpdateIndicatorWithNewValue

func (ind StochOsc) UpdateIndicatorWithNewValue(newSlowKValue float64, newSlowDValue float64, streamBarIndex int)

type StochOscWithoutStorage

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

A Stochastic Oscillator Indicator (StochOsc), no storage, for use in other indicators

func NewStochOscWithoutStorage

func NewStochOscWithoutStorage(fastKTimePeriod int, slowKTimePeriod int, slowDTimePeriod int, valueAvailableAction ValueAvailableActionStoch) (indicator *StochOscWithoutStorage, err error)

NewStochOscWithoutStorage creates a Stochastic Oscillator Indicator (StochOsc) without storage

func (*StochOscWithoutStorage) ReceiveDOHLCVTick

func (ind *StochOscWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (StochOscWithoutStorage) UpdateIndicatorWithNewValue

func (ind StochOscWithoutStorage) UpdateIndicatorWithNewValue(newSlowKValue float64, newSlowDValue float64, streamBarIndex int)

type StochRsi

type StochRsi struct {
	*StochRsiWithoutStorage

	// public variables
	SlowK []float64
	SlowD []float64
}

A Stochastic Relative Strength Indicator (StochRsi)

func NewDefaultStochRsi

func NewDefaultStochRsi() (indicator *StochRsi, err error)

NewDefaultStochRsi creates a Stochastic Relative Strength Indicator (StochRsi) for online usage with default parameters

  • timePeriod : 14
  • fastKTimePeriod : 5
  • fastDTimePeriod : 3

func NewDefaultStochRsiForStream

func NewDefaultStochRsiForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StochRsi, err error)

NewDefaultStochRsiForStream creates a Stochastic Relative Strength Indicator (StochRsi) for online usage with a source data stream

func NewDefaultStochRsiForStreamWithSrcLen

func NewDefaultStochRsiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *StochRsi, err error)

NewDefaultStochRsiForStreamWithSrcLen creates a Stochastic Relative Strength Indicator (StochRsi) for offline usage with a source data stream

func NewDefaultStochRsiWithSrcLen

func NewDefaultStochRsiWithSrcLen(sourceLength uint) (indicator *StochRsi, err error)

NewDefaultStochRsiWithSrcLen creates a Stochastic Relative Strength Indicator (StochRsi) for offline usage with default parameters

func NewStochRsi

func NewStochRsi(timePeriod int, fastKTimePeriod int, fastDTimePeriod int) (indicator *StochRsi, err error)

NewStochRsi creates a Stochastic Relative Strength Indicator (StochRsi) for online usage

func NewStochRsiForStream

func NewStochRsiForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, fastKTimePeriod int, fastDTimePeriod int) (indicator *StochRsi, err error)

NewStochRsiForStream creates a Stochastic Relative Strength Indicator (StochRsi) for online usage with a source data stream

func NewStochRsiForStreamWithSrcLen

func NewStochRsiForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, fastKTimePeriod int, fastDTimePeriod int) (indicator *StochRsi, err error)

NewStochRsiForStreamWithSrcLen creates a Stochastic Relative Strength Indicator (StochRsi) for offline usage with a source data stream

func NewStochRsiWithSrcLen

func NewStochRsiWithSrcLen(sourceLength uint, timePeriod int, fastKTimePeriod int, fastDTimePeriod int) (indicator *StochRsi, err error)

NewStochRsiWithSrcLen creates a Stochastic Relative Strength Indicator (StochRsi) for offline usage

func (StochRsi) UpdateIndicatorWithNewValue

func (ind StochRsi) UpdateIndicatorWithNewValue(newSlowKValue float64, newSlowDValue float64, streamBarIndex int)

type StochRsiWithoutStorage

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

A Stochastic Relative Strength Indicator (StochRsi), no storage, for use in other indicators

func NewStochRsiWithoutStorage

func NewStochRsiWithoutStorage(timePeriod int, fastKTimePeriod int, fastDTimePeriod int, valueAvailableAction ValueAvailableActionStoch) (indicator *StochRsiWithoutStorage, err error)

NewStochRsiWithoutStorage creates a Stochastic Relative Strength Indicator (StochRsi) without storage

func (*StochRsiWithoutStorage) ReceiveDOHLCVTick

func (ind *StochRsiWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (StochRsiWithoutStorage) UpdateIndicatorWithNewValue

func (ind StochRsiWithoutStorage) UpdateIndicatorWithNewValue(newSlowKValue float64, newSlowDValue float64, streamBarIndex int)

type Tema

type Tema struct {
	*TemaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Tripple Exponential Moving Average Indicator (Tema)

func NewDefaultTema

func NewDefaultTema() (indicator *Tema, err error)

NewDefaultTema creates a Tripple Exponential Moving Average Indicator (Tema) for online usage with default parameters

  • timePeriod: 30

func NewDefaultTemaForStream

func NewDefaultTemaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Tema, err error)

NewDefaultTemaForStream creates a Tripple Exponential Moving Average Indicator (Tema) for online usage with a source data stream

func NewDefaultTemaForStreamWithSrcLen

func NewDefaultTemaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Tema, err error)

NewDefaultTemaForStreamWithSrcLen creates a Tripple Exponential Moving Average Indicator (Tema) for offline usage with a source data stream

func NewDefaultTemaWithSrcLen

func NewDefaultTemaWithSrcLen(sourceLength uint) (indicator *Tema, err error)

NewDefaultTemaWithSrcLen creates a Tripple Exponential Moving Average Indicator (Tema) for offline usage with default parameters

func NewTema

func NewTema(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tema, err error)

NewTema creates a Tripple Exponential Moving Average Indicator (Tema) for online usage

func NewTemaForStream

func NewTemaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tema, err error)

NewTemaForStream creates a Tripple Exponential Moving Average Indicator (Tema) for online usage with a source data stream

func NewTemaForStreamWithSrcLen

func NewTemaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tema, err error)

NewTemaForStreamWithSrcLen creates a Tripple Exponential Moving Average Indicator (Tema) for offline usage with a source data stream

func NewTemaWithSrcLen

func NewTemaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tema, err error)

NewTemaWithSrcLen creates a Tripple Exponential Moving Average Indicator (Tema) for offline usage

func (*Tema) ReceiveDOHLCVTick

func (ind *Tema) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Tema) UpdateIndicatorWithNewValue

func (ind Tema) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type TemaWithoutStorage

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

A Tripple Exponential Moving Average Indicator (Tema), no storage, for use in other indicators

func NewTemaWithoutStorage

func NewTemaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *TemaWithoutStorage, err error)

func (*TemaWithoutStorage) ReceiveTick

func (ind *TemaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (TemaWithoutStorage) UpdateIndicatorWithNewValue

func (ind TemaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Trima

type Trima struct {
	*TrimaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Triangular Moving Average Indicator (Trima)

func NewDefaultTrima

func NewDefaultTrima() (indicator *Trima, err error)

NewDefaultTrima creates a Triangular Moving Average Indicator (Trima) for online usage with default parameters

  • timePeriod: 30

func NewDefaultTrimaForStream

func NewDefaultTrimaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Trima, err error)

NewDefaultTrimaForStream creates a Triangular Moving Average Indicator (Trima) for online usage with a source data stream

func NewDefaultTrimaForStreamWithSrcLen

func NewDefaultTrimaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Trima, err error)

NewDefaultTrimaForStreamWithSrcLen creates a Triangular Moving Average Indicator (Trima) for offline usage with a source data stream

func NewDefaultTrimaWithSrcLen

func NewDefaultTrimaWithSrcLen(sourceLength uint) (indicator *Trima, err error)

NewDefaultTrimaWithSrcLen creates a Triangular Moving Average Indicator (Trima) for offline usage with default parameters

func NewTrima

func NewTrima(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Trima, err error)

NewTrima creates a Triangular Moving Average Indicator (Trima) for online usage

func NewTrimaForStream

func NewTrimaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Trima, err error)

NewTrimaForStream creates a Triangular Moving Average Indicator (Trima) for online usage with a source data stream

func NewTrimaForStreamWithSrcLen

func NewTrimaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Trima, err error)

NewTrimaForStreamWithSrcLen creates a Triangular Moving Average Indicator (Trima) for offline usage with a source data stream

func NewTrimaWithSrcLen

func NewTrimaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Trima, err error)

NewTrimaWithSrcLen creates a Triangular Moving Average Indicator (Trima) for offline usage

func (*Trima) ReceiveDOHLCVTick

func (tema *Trima) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Trima) UpdateIndicatorWithNewValue

func (ind Trima) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type TrimaWithoutStorage

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

A Triangular Moving Average Indicator (Trima), no storage, for use in other indicators

func NewTrimaWithoutStorage

func NewTrimaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *TrimaWithoutStorage, err error)

NewTrimaWithoutStorage creates a Triangular Moving Average Indicator (Trima) without storage

func (*TrimaWithoutStorage) ReceiveTick

func (tema *TrimaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (TrimaWithoutStorage) UpdateIndicatorWithNewValue

func (ind TrimaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type TrueRange

type TrueRange struct {
	*TrueRangeWithoutStorage

	// public variables
	Data []float64
}

A True Range Indicator (TrueRange)

func NewTrueRange

func NewTrueRange() (indicator *TrueRange, err error)

NewTrueRange creates a True Range Indicator (TrueRange) for online usage

func NewTrueRangeForStream

func NewTrueRangeForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *TrueRange, err error)

NewTrueRangeForStream creates a True Range Indicator (TrueRange) for online usage with a source data stream

func NewTrueRangeForStreamWithSrcLen

func NewTrueRangeForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *TrueRange, err error)

NewTrueRangeForStreamWithSrcLen creates a True Range Indicator (TrueRange) for offline usage with a source data stream

func NewTrueRangeWithSrcLen

func NewTrueRangeWithSrcLen(sourceLength uint) (indicator *TrueRange, err error)

NewTrueRangeWithSrcLen creates a True Range Indicator (TrueRange) for offline usage

func (TrueRange) UpdateIndicatorWithNewValue

func (ind TrueRange) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type TrueRangeWithoutStorage

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

A True Range Indicator (TrueRange), no storage, for use in other indicators

func NewTrueRangeWithoutStorage

func NewTrueRangeWithoutStorage(valueAvailableAction ValueAvailableActionFloat) (indicator *TrueRangeWithoutStorage, err error)

NewTrueRangeWithoutStorage creates a True Range Indicator (TrueRange) without storage

func (*TrueRangeWithoutStorage) ReceiveDOHLCVTick

func (ind *TrueRangeWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (TrueRangeWithoutStorage) UpdateIndicatorWithNewValue

func (ind TrueRangeWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Tsf

type Tsf struct {
	*LinRegWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Time Series Forecast Indicator (Tsf)

func NewDefaultTsf

func NewDefaultTsf() (indicator *Tsf, err error)

NewDefaultTsf creates a Time Series Forecast Indicator (Tsf) for online usage with default parameters

  • timePeriod: 10

func NewDefaultTsfForStream

func NewDefaultTsfForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Tsf, err error)

NewDefaultTsfForStream creates a Time Series Forecast Indicator (Tsf) for online usage with a source data stream

func NewDefaultTsfForStreamWithSrcLen

func NewDefaultTsfForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Tsf, err error)

NewDefaultTsfForStreamWithSrcLen creates a Time Series Forecast Indicator (Tsf) for offline usage with a source data stream

func NewDefaultTsfWithSrcLen

func NewDefaultTsfWithSrcLen(sourceLength uint) (indicator *Tsf, err error)

NewDefaultTsfWithSrcLen creates a Time Series Forecast Indicator (Tsf) for offline usage with default parameters

func NewTsf

func NewTsf(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tsf, err error)

NewTsf creates a Time Series Forecast Indicator (Tsf) for online usage

func NewTsfForStream

func NewTsfForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tsf, err error)

NewTsfForStream creates a Time Series Forecast Indicator (Tsf) for online usage with a source data stream

func NewTsfForStreamWithSrcLen

func NewTsfForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tsf, err error)

NewTsfForStreamWithSrcLen creates a Time Series Forecast Indicator (Tsf) for offline usage with a source data stream

func NewTsfWithSrcLen

func NewTsfWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Tsf, err error)

NewTsfWithSrcLen creates a Time Series Forecast Indicator (Tsf) for offline usage

func (Tsf) GetLookbackPeriod

func (ind Tsf) GetLookbackPeriod() int

func (Tsf) IncDataLength

func (ind Tsf) IncDataLength()

func (Tsf) Length

func (ind Tsf) Length() int

func (Tsf) MaxValue

func (ind Tsf) MaxValue() float64

func (Tsf) MinValue

func (ind Tsf) MinValue() float64

func (*Tsf) ReceiveDOHLCVTick

func (ind *Tsf) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Tsf) SetValidFromBar

func (ind Tsf) SetValidFromBar(streamBarIndex int)

func (Tsf) UpdateMinMax

func (ind Tsf) UpdateMinMax(minCandidate float64, maxCandidate float64)

func (Tsf) ValidFromBar

func (ind Tsf) ValidFromBar() int

type TypPrice

type TypPrice struct {
	*TypPriceWithoutStorage

	// public variables
	Data []float64
}

A Typical Price Indicator (TypPrice)

func NewTypPrice

func NewTypPrice() (indicator *TypPrice, err error)

NewTypPrice creates a Typical Price Indicator (TypPrice) for online usage

func NewTypPriceForStream

func NewTypPriceForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *TypPrice, err error)

NewTypPriceForStream creates a Typical Price Indicator (TypPrice) for online usage with a source data stream

func NewTypPriceForStreamWithSrcLen

func NewTypPriceForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *TypPrice, err error)

NewTypPriceForStreamWithSrcLen creates a Typical Price Indicator (TypPrice) for offline usage with a source data stream

func NewTypPriceWithSrcLen

func NewTypPriceWithSrcLen(sourceLength uint) (indicator *TypPrice, err error)

NewTypPriceWithSrcLen creates a Typical Price Indicator (TypPrice) for offline usage

func (TypPrice) UpdateIndicatorWithNewValue

func (ind TypPrice) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type TypPriceWithoutStorage

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

func NewTypPriceWithoutStorage

func NewTypPriceWithoutStorage(valueAvailableAction ValueAvailableActionFloat) (indicator *TypPriceWithoutStorage, err error)

func (*TypPriceWithoutStorage) ReceiveDOHLCVTick

func (ind *TypPriceWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (TypPriceWithoutStorage) UpdateIndicatorWithNewValue

func (ind TypPriceWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type ValueAvailableActionAroon

type ValueAvailableActionAroon func(dataItemAroonUp float64, dataItemAroonDown float64, streamBarIndex int)

type ValueAvailableActionBollinger

type ValueAvailableActionBollinger func(dataItemUpperBand float64, dataItemMiddleBand float64, dataItemLowerBand float64, streamBarIndex int)

type ValueAvailableActionDOHLCV

type ValueAvailableActionDOHLCV func(dataItem gotrade.DOHLCV, streamBarIndex int)

type ValueAvailableActionFloat

type ValueAvailableActionFloat func(dataItem float64, streamBarIndex int)

type ValueAvailableActionInt

type ValueAvailableActionInt func(dataItem int64, streamBarIndex int)

type ValueAvailableActionLinearReg

type ValueAvailableActionLinearReg func(dataItem float64, slope float64, intercept float64, streamBarIndex int)

type ValueAvailableActionMacd

type ValueAvailableActionMacd func(dataItemMacd float64, dataItemSignal float64, dataItemHistogram float64, streamBarIndex int)

type ValueAvailableActionStoch

type ValueAvailableActionStoch func(dataItemK float64, dataItemD float64, streamBarIndex int)

type Var

type Var struct {
	*VarWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Variance Indicator (Var)

func NewDefaultVar

func NewDefaultVar() (indicator *Var, err error)

NewDefaultVar creates a Variance Indicator (Var) for online usage with default parameters

  • timePeriod: 10

func NewDefaultVarForStream

func NewDefaultVarForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Var, err error)

NewDefaultVarForStream creates a Variance Indicator (Var) for online usage with a source data stream

func NewDefaultVarForStreamWithSrcLen

func NewDefaultVarForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Var, err error)

NewDefaultVarForStreamWithSrcLen creates a Variance Indicator (Var) for offline usage with a source data stream

func NewDefaultVarWithSrcLen

func NewDefaultVarWithSrcLen(sourceLength uint) (indicator *Var, err error)

NewDefaultVarWithSrcLen creates a Variance Indicator (Var) for offline usage with default parameters

func NewVar

func NewVar(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Var, err error)

NewVar creates a Variance Indicator (Var) for online usage

func NewVarForStream

func NewVarForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Var, err error)

NewVarForStream creates a Variance Indicator (Var) for online usage with a source data stream

func NewVarForStreamWithSrcLen

func NewVarForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Var, err error)

NewVarForStreamWithSrcLen creates a Variance Indicator (Var) for offline usage with a source data stream

func NewVarWithSrcLen

func NewVarWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Var, err error)

NewVarWithSrcLen creates a Variance Indicator (Var) for offline usage

func (*Var) ReceiveDOHLCVTick

func (ind *Var) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Var) UpdateIndicatorWithNewValue

func (ind Var) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type VarWithoutStorage

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

A Variance Indicator (Var), no storage, for use in other indicators

func NewVarWithoutStorage

func NewVarWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *VarWithoutStorage, err error)

NewVarWithoutStorage creates a Variance Indicator (Var) without storage

func (*VarWithoutStorage) ReceiveTick

func (ind *VarWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance - Knuth

func (VarWithoutStorage) UpdateIndicatorWithNewValue

func (ind VarWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type WillR

type WillR struct {
	*WillRWithoutStorage

	// public variables
	Data []float64
}

A Simple Moving Average Indicator

func NewDefaultWillR

func NewDefaultWillR() (indicator *WillR, err error)

NewDefaultWillR creates a Williams Percent R Indicator (WillR) for online usage with default parameters

  • timePeriod: 14

func NewDefaultWillRForStream

func NewDefaultWillRForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *WillR, err error)

NewDefaultWillRForStream creates a Williams Percent R Indicator (WillR) for online usage with a source data stream

func NewDefaultWillRForStreamWithSrcLen

func NewDefaultWillRForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *WillR, err error)

NewDefaultWillRForStreamWithSrcLen creates a Williams Percent R Indicator (WillR) for offline usage with a source data stream

func NewDefaultWillRWithSrcLen

func NewDefaultWillRWithSrcLen(sourceLength uint) (indicator *WillR, err error)

NewDefaultWillRWithSrcLen creates a Williams Percent R Indicator (WillR) for offline usage with default parameters

func NewWillR

func NewWillR(timePeriod int) (indicator *WillR, err error)

NewWillR creates a Williams Percent R Indicator (WillR) for online usage

func NewWillRForStream

func NewWillRForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *WillR, err error)

NewWillRForStream creates a Williams Percent R Indicator (WillR) for online usage with a source data stream

func NewWillRForStreamWithSrcLen

func NewWillRForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int) (indicator *WillR, err error)

NewWillRForStreamWithSrcLen creates a Williams Percent R Indicator (WillR) for offline usage with a source data stream

func NewWillRWithSrcLen

func NewWillRWithSrcLen(sourceLength uint, timePeriod int) (indicator *WillR, err error)

NewWillRWithSrcLen creates a Williams Percent R Indicator (WillR) for offline usage

func (WillR) UpdateIndicatorWithNewValue

func (ind WillR) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type WillRWithoutStorage

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

A Williamns Percent R Indicator

func NewWillRWithoutStorage

func NewWillRWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *WillRWithoutStorage, err error)

NewWillRWithoutStorage creates a Williams Percent R Indicator (WillR) without storage

func (*WillRWithoutStorage) ReceiveDOHLCVTick

func (ind *WillRWithoutStorage) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (WillRWithoutStorage) UpdateIndicatorWithNewValue

func (ind WillRWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type Wma

type Wma struct {
	*WmaWithoutStorage

	// public variables
	Data []float64
	// contains filtered or unexported fields
}

A Weighted Moving Average Indicator (Wma)

func NewDefaultWma

func NewDefaultWma() (indicator *Wma, err error)

NewDefaultWma creates a Weighted Moving Average Indicator (Wma) for online usage with default parameters

  • timePeriod: 10

func NewDefaultWmaForStream

func NewDefaultWmaForStream(priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Wma, err error)

NewDefaultWmaForStream creates a Weighted Moving Average Indicator (Wma) for online usage with a source data stream

func NewDefaultWmaForStreamWithSrcLen

func NewDefaultWmaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber) (indicator *Wma, err error)

NewDefaultWmaForStreamWithSrcLen creates a Weighted Moving Average Indicator (Wma) for offline usage with a source data stream

func NewDefaultWmaWithSrcLen

func NewDefaultWmaWithSrcLen(sourceLength uint) (indicator *Wma, err error)

NewDefaultWmaWithSrcLen creates a Weighted Moving Average Indicator (Wma) for offline usage with default parameters

func NewWma

func NewWma(timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Wma, err error)

NewWma creates a Weighted Moving Average Indicator (Wma) for online usage

func NewWmaForStream

func NewWmaForStream(priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Wma, err error)

NewWmaForStream creates a Weighted Moving Average Indicator (Wma) for online usage with a source data stream

func NewWmaForStreamWithSrcLen

func NewWmaForStreamWithSrcLen(sourceLength uint, priceStream gotrade.DOHLCVStreamSubscriber, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Wma, err error)

NewWmaForStreamWithSrcLen creates a Weighted Moving Average Indicator (Wma) for offline usage with a source data stream

func NewWmaWithSrcLen

func NewWmaWithSrcLen(sourceLength uint, timePeriod int, selectData gotrade.DOHLCVDataSelectionFunc) (indicator *Wma, err error)

NewWmaWithSrcLen creates a Weighted Moving Average Indicator (Wma) for offline usage

func (*Wma) ReceiveDOHLCVTick

func (ind *Wma) ReceiveDOHLCVTick(tickData gotrade.DOHLCV, streamBarIndex int)

ReceiveDOHLCVTick consumes a source data DOHLCV price tick

func (Wma) UpdateIndicatorWithNewValue

func (ind Wma) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

type WmaWithoutStorage

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

A Weighted Moving Average Indicator (Wma), no storage, for use in other indicators

func NewWmaWithoutStorage

func NewWmaWithoutStorage(timePeriod int, valueAvailableAction ValueAvailableActionFloat) (indicator *WmaWithoutStorage, err error)

NewWmaWithoutStorage creates a Weighted Moving Average Indicator (Wma) without storage

func (*WmaWithoutStorage) ReceiveTick

func (ind *WmaWithoutStorage) ReceiveTick(tickData float64, streamBarIndex int)

func (WmaWithoutStorage) UpdateIndicatorWithNewValue

func (ind WmaWithoutStorage) UpdateIndicatorWithNewValue(newValue float64, streamBarIndex int)

Jump to

Keyboard shortcuts

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