Documentation ¶
Overview ¶
Package realtime 实时数据相关的功能集合
Index ¶
- func AlphaOfExponentialMovingAverage(period int) float64
- func DynamicExponentialMovingAverage(snapshot factors.QuoteSnapshot, last, alpha float64) (ema, emaHigh, emaLow float64)
- func DynamicMovingAverage(previousHalfValue float64, period int, snapshot factors.QuoteSnapshot) (ma, maHigh, maLow float64)
- func DynamicMovingAverageConvergenceDivergence(snapshot factors.QuoteSnapshot, lastShort, lastLong, lastDea float64, ...) (macd, macdHigh, macdLow float64)
- func IncrementalExponentialMovingAverage(now, last, alpha float64) float64
- func IncrementalMovingAverage(previousHalfValue float64, period int, price float64) float64
- func IncrementalMovingAverageConvergenceDivergence(price, lastShort, lastLong, lastDea float64, pShort, pLong, pMid int) (DIF, DEA, MACD float64)
- func MovingAverage(CLOSE, HIGH, LOW pandas.Series, PN int) (ma, half, maMax, maMin pandas.Series)
- func MovingAverageConvergenceDivergence(CLOSE pandas.Series, pShort, pLong, pMid int) (SHORT, LONG, DIF, DEA, MACD float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlphaOfExponentialMovingAverage ¶ added in v1.4.7
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
IncrementalExponentialMovingAverage 增量计算 指数移动平均线
func IncrementalMovingAverage ¶ added in v0.7.9
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.