indicator

package module
v0.0.0-...-facbc01 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 2 Imported by: 0

README

indicator

Some indicators like MACD,KDJ,BOLL etc with Golang

#技术指标 用Go实现的一些常用的技术指标,比如:MACD,KDJ,BOLL等

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boll

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

func NewBoll

func NewBoll(n int, k int32) *Boll

NewBoll(20, 2)

func (*Boll) Boll

func (this *Boll) Boll(lines []Kline) (mid []float64, up []float64, low []float64)

type Ema

type Ema struct {
	Weight float64
	// contains filtered or unexported fields
}

func NewEma

func NewEma(weight int32) *Ema

func (*Ema) Clone

func (this *Ema) Clone() *Ema

func (*Ema) Update

func (this *Ema) Update(price float64) float64

type Kdj

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

func NewKdj

func NewKdj(n1 int, n2 int, n3 int) *Kdj

NewKdj(9, 3, 3)

func (*Kdj) Kdj

func (this *Kdj) Kdj(bids []Kline) (k, d, j []float64)

type Kline

type Kline struct {
	Time  time.Time
	Open  float64
	Close float64
	High  float64
	Low   float64
	Vol   float64
	Money float64
}

type Macd

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

func NewMacd

func NewMacd(short, long, signal int32) *Macd

func (*Macd) Clone

func (this *Macd) Clone() *Macd

func (*Macd) Update

func (this *Macd) Update(price float64) (float64, float64, float64)

Jump to

Keyboard shortcuts

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