indicator

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 6 Imported by: 6 modules, 28 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateKLinesEMA added in v1.3.1

func CalculateKLinesEMA(allKLines []types.KLine, priceF KLinePriceMapper, window int) float64

func KLineClosePriceMapper added in v1.2.1

func KLineClosePriceMapper(k types.KLine) float64

func KLineOpenPriceMapper added in v1.2.1

func KLineOpenPriceMapper(k types.KLine) float64

func MapKLinePrice added in v1.2.1

func MapKLinePrice(kLines []types.KLine, f KLinePriceMapper) (prices []float64)

Types

type BOLL

type BOLL struct {
	types.IntervalWindow

	// times of Std, generally it's 2
	K float64

	SMA      Float64Slice
	StdDev   Float64Slice
	UpBand   Float64Slice
	DownBand Float64Slice

	EndTime time.Time
	// contains filtered or unexported fields
}

func (*BOLL) Bind

func (inc *BOLL) Bind(updater KLineWindowUpdater)

func (*BOLL) EmitUpdate

func (inc *BOLL) EmitUpdate(sma float64, upBand float64, downBand float64)

func (*BOLL) LastDownBand

func (inc *BOLL) LastDownBand() float64

func (*BOLL) LastSMA

func (inc *BOLL) LastSMA() float64

func (*BOLL) LastStdDev

func (inc *BOLL) LastStdDev() float64

func (*BOLL) LastUpBand

func (inc *BOLL) LastUpBand() float64

func (*BOLL) OnUpdate

func (inc *BOLL) OnUpdate(cb func(sma float64, upBand float64, downBand float64))

type EWMA

type EWMA struct {
	types.IntervalWindow
	Values       Float64Slice
	LastOpenTime time.Time

	UpdateCallbacks []func(value float64)
}

func (*EWMA) Bind

func (inc *EWMA) Bind(updater KLineWindowUpdater)

func (*EWMA) EmitUpdate added in v1.2.1

func (inc *EWMA) EmitUpdate(value float64)

func (*EWMA) Last

func (inc *EWMA) Last() float64

func (*EWMA) OnUpdate added in v1.2.1

func (inc *EWMA) OnUpdate(cb func(value float64))

type Float64Slice

type Float64Slice []float64

func (*Float64Slice) Push

func (s *Float64Slice) Push(v float64)

type KLinePriceMapper added in v1.2.1

type KLinePriceMapper func(k types.KLine) float64

type KLineWindowUpdater

type KLineWindowUpdater interface {
	OnKLineWindowUpdate(func(interval types.Interval, window types.KLineWindow))
}

type SMA

type SMA struct {
	types.IntervalWindow
	Values  Float64Slice
	EndTime time.Time

	UpdateCallbacks []func(value float64)
}

func (*SMA) Bind

func (inc *SMA) Bind(updater KLineWindowUpdater)

func (*SMA) EmitUpdate added in v1.2.1

func (inc *SMA) EmitUpdate(value float64)

func (*SMA) Last

func (inc *SMA) Last() float64

func (*SMA) OnUpdate added in v1.2.1

func (inc *SMA) OnUpdate(cb func(value float64))

Jump to

Keyboard shortcuts

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