Documentation ¶
Index ¶
- func ABS(S stat.Series) stat.Series
- func AND[T stat.Number | ~bool](a, b []T) []bool
- func AVEDEV(S stat.Series, N any) stat.Series
- func BARSLAST(S stat.Series) stat.Series
- func BARSLAST2(S stat.Series) []stat.DType
- func BARSLASTCOUNT(S stat.Series) stat.Series
- func BARSSINCEN(S stat.Series, N any) stat.Series
- func CONST(S stat.Series) stat.Series
- func COUNT(S []bool, N int) []int
- func CROSS(S1, S2 []stat.DType) []bool
- func CROSS1(S1, S2 stat.Series) []bool
- func CompareGt(v []stat.DType, x any) []bool
- func CompareGte(v []stat.DType, x any) []bool
- func CompareLt(v []stat.DType, x any) []bool
- func CompareLte(v []stat.DType, x any) []bool
- func DMA(S stat.Series, A any) []stat.DType
- func EMA(S stat.Series, N any) stat.Series
- func EMA_v0(S stat.Series, N any) any
- func EMA_v1(S stat.Series, N any) any
- func EMA_v2(S stat.Series, N any) any
- func EQ(S1, S2 stat.Series) []bool
- func EQ2(S1 []stat.DType, S2 int) []bool
- func FILTER(S stat.Series, N any) stat.Series
- func FORCAST(S stat.Series, N any) any
- func HHV(S stat.Series, N any) stat.Series
- func HHVBARS(S stat.Series, N any) stat.Series
- func IF(S, A, B stat.Series) stat.Series
- func IFF(S, A, B stat.Series) stat.Series
- func IFN(S, A, B stat.Series) stat.Series
- func LAST(X stat.Series, A, B int) stat.Series
- func LLV(S stat.Series, N any) stat.Series
- func LLVBARS(S stat.Series, N any) stat.Series
- func MA(S stat.Series, N any) []stat.DType
- func MA2(S stat.Series, N any) stat.Series
- func MAX(S1 stat.Series, S2 any) stat.Series
- func MIN(S1 stat.Series, S2 any) stat.Series
- func OR(a, b []bool) []bool
- func REF(S stat.Series, N any) stat.Series
- func REF2[T stat.BaseType](S []T, N any) []T
- func SLOPE(S stat.Series, N any) any
- func SMA(S stat.Series, N any, M int) stat.Series
- func SMA_v1(S stat.Series, N int, M int) any
- func SMA_v3(S stat.Series, N any, M int) any
- func SMA_v4(S stat.Series, N any, M int) any
- func SMA_v5(S stat.Series, N any, M int) any
- func SQRT(S stat.Series) []stat.DType
- func STD(S stat.Series, N any) stat.Series
- func SUM(S stat.Series, N any) stat.Series
- func WMA(S stat.Series, N any) stat.Series
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BARSLAST ¶
BARSLAST 上一次条件成立到当前的周期, BARSLAST(C/REF(C,1)>=1.1) 上一次涨停到今天的天数
为了测试SMA,BARSLAST必须要先实现, 给SMA提供序列换参数, 以便验证, python那边还没实现
func BARSSINCEN ¶
BARSSINCEN N周期内第一次S条件成立到现在的周期数,N为常量
func DMA ¶
DMA 返回动态移动平均
求S的动态移动平均, A作平滑因子,必须 0<A<1 (此为核心函数,非指标) 用法: DMA(X,A),求X的动态移动平均 算法:Y=A*X+(1-A)*Y',其中Y'表示上一周期Y值,A必须大于0且小于1.A支持变量 例如: DMA(CLOSE,VOL/CAPITAL)表示求以换手率作平滑因子的平均价
func EMA ¶
EMA 指数移动平均,为了精度 S>4*N EMA至少需要120周期 alpha=2/(span+1) TODO:这个版本是对的, 通达信EMA居然实现了真的序列, 那为啥SMA不是呢?!
func FILTER ¶ added in v0.6.6
FILTER 过滤连续出现的信号
用法: FILTER(X,N):X满足条件后,将其后N周期内的数据置为0,N为常量. 例如: FILTER(CLOSE>OPEN,5)查找阳线,5天内再次出现的阳线不被记录在内
func HHVBARS ¶ added in v0.6.6
HHVBARS 求上一高点到当前的周期数.
用法: HHVBARS(X,N):求N周期内X最高值到当前周期数,N=0表示从第一个有效值开始统计 例如: HHVBARS(HIGH,0)求得历史新高到到当前的周期数
func LAST ¶
LAST LAST(X,A,B):持续存在.
A 支持序列化, B不支持 例如: LAST(CLOSE>OPEN,10,5) 表示从前10日到前5日内一直阳线 若A为0,表示从第一天开始,B为0,表示到最后日止
func LLVBARS ¶ added in v0.6.6
LLVBARS 求上一低点到当前的周期数.
用法: LLVBARS(X,N):求N周期内X最低值到当前周期数,N=0表示从第一个有效值开始统计 例如: LLVBARS(HIGH,20)求得20日最低点到当前的周期数
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.