realtime

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package realtime 实时数据相关的功能集合

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaOfExponentialMovingAverage added in v1.4.7

func AlphaOfExponentialMovingAverage(period int) float64

AlphaOfExponentialMovingAverage 计算EMA的alpha值

func DynamicExponentialMovingAverage added in v1.4.7

func DynamicExponentialMovingAverage(snapshot factors.QuoteSnapshot, last, alpha float64) (ema, emaHigh, emaLow float64)

DynamicExponentialMovingAverage 动态EMA

返回当前值以及最高值和最低值

func DynamicMovingAverage added in v1.0.0

func DynamicMovingAverage(previousHalfValue float64, period int, snapshot factors.QuoteSnapshot) (ma, maHigh, maLow float64)

DynamicMovingAverage 增量计算移动平均线的范围

period 周期数
previousHalfValue 前period-1的平均值
price 现价

func DynamicMovingAverageConvergenceDivergence added in v1.4.7

func DynamicMovingAverageConvergenceDivergence(snapshot factors.QuoteSnapshot, lastShort, lastLong, lastDea float64, pShort, pLong, pMid int) (macd, macdHigh, macdLow float64)

DynamicMovingAverageConvergenceDivergence 动态的MACD

返回当前值以及最高值和最低值
price 为现价
lastShort, lastLong, lastDea, 缓存的短,长周期的ema, 以及最后一条dea
pShort, pLong, pMid, 为短期,长期和中期周期数

func IncrementalExponentialMovingAverage added in v1.4.7

func IncrementalExponentialMovingAverage(now, last, alpha float64) float64

IncrementalExponentialMovingAverage 增量计算 指数移动平均线

func IncrementalMovingAverage added in v0.7.9

func IncrementalMovingAverage(previousHalfValue float64, period int, price float64) float64

IncrementalMovingAverage 增量计算移动平均线

period 周期数
previousHalfValue 前period-1的平均值
price 现价

func IncrementalMovingAverageConvergenceDivergence added in v1.4.7

func IncrementalMovingAverageConvergenceDivergence(price, lastShort, lastLong, lastDea float64, pShort, pLong, pMid int) (DIF, DEA, MACD float64)

IncrementalMovingAverageConvergenceDivergence 增量的MACD

price 为现价
lastShort, lastLong, lastDea, 缓存的短,长周期的ema, 以及最后一条dea
pShort, pLong, pMid, 为短期,长期和中期周期数

func MovingAverage

func MovingAverage(CLOSE, HIGH, LOW pandas.Series, PN int) (ma, half, maMax, maMin pandas.Series)

MovingAverage 计算均线范围

func MovingAverageConvergenceDivergence added in v1.4.7

func MovingAverageConvergenceDivergence(CLOSE pandas.Series, pShort, pLong, pMid int) (SHORT, LONG, DIF, DEA, MACD float64)

MovingAverageConvergenceDivergence 平滑异同移动平均线(Moving Average Convergence Divergence)

返回最新一条macd的5个值
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID)
MACD:(DIF-DEA)*2,COLORSTICK;

Types

This section is empty.

Jump to

Keyboard shortcuts

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