indicator

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 3 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

This section is empty.

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
	EndTime time.Time
}

func (*EWMA) Bind

func (inc *EWMA) Bind(updater KLineWindowUpdater)

func (*EWMA) Last

func (inc *EWMA) Last() float64

type Float64Slice

type Float64Slice []float64

func (*Float64Slice) Push

func (s *Float64Slice) Push(v 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
}

func (*SMA) Bind

func (inc *SMA) Bind(updater KLineWindowUpdater)

func (*SMA) Last

func (inc *SMA) Last() float64

Jump to

Keyboard shortcuts

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