base

package
v0.0.0-...-cd9138d Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2015 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

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

基本类型

func (*Base) I

func (b *Base) I(i int) float64

func (*Base) Set

func (b *Base) Set(A []float64)

func (*Base) Value

func (b *Base) Value() []float64

type Valuer

type Valuer interface {
	Value() []float64
	I(i int) float64
}

基本类型

func Add

func Add(A, B Valuer) Valuer

基本元素的加法,减法等 前提是A,B的数据不为nil也就是说在进行数据处理时要先进行数据监测

func Div

func Div(A, B Valuer) Valuer

func DivWithNub

func DivWithNub(A Valuer, B int) Valuer

func EMA

func EMA(A Valuer, B int) Valuer

含义:求指数平滑移动平均。 用法:EMA(X,N),求X的N日指数平滑移动平均。算法:若Y=EMA(X,N)则Y=[2*X+(N-1)*Y']/(N+1),其中Y'表示上一周期Y值。例如:EMA(CLOSE,30)表示求30日指数平滑均价。

func HHV

func HHV(A Valuer, B int) Valuer

func LLV

func LLV(A Valuer, B int) Valuer

func Mul

func Mul(A, B Valuer) Valuer

func MulWithNub

func MulWithNub(A Valuer, B int) Valuer

func REF

func REF(A Valuer, B int) Valuer

func SMA

func SMA(A Valuer, B, C int) Valuer

含义:求移动平均。 用法:SMA(X,N,M),求X的N日移动平均,M为权重。算法: 若Y=SMA(X,N,M)则 Y=[M*X+(N-M)*Y']/N,其中Y'表示上一周期Y值,N必须大于M。例如:SMA(CLOSE,30,1)表示求30日移动平均价。

func Sub

func Sub(A, B Valuer) Valuer

Jump to

Keyboard shortcuts

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