MACDIndicator class

MACD:参数快线移动平均、慢线移动平均、移动平均, 默认参数值12、26、9。 公式:⒈首先分别计算出收盘价12日指数平滑移动平均线与26日指数平滑移动平均线,分别记为EMA(12)与EMA(26)。 ⒉求这两条指数平滑移动平均线的差,即:DIFF = EMA(SHORT) - EMA(LONG)。 ⒊再计算DIFF的M日的平均的指数平滑移动平均线,记为DEA。 ⒋最后用DIFF减DEA,得MACD。MACD通常绘制成围绕零轴线波动的柱形图。MACD柱状大于0涨颜色,小于0跌颜色。

Inheritance

Constructors

MACDIndicator({MACDStyle indicatorStyle = const MACDStyle()})

Properties

calcParams List<int>
finalinherited
hashCode int
The hash code for this object.
no setterinherited
indicatorStyle MACDStyle
finalinherited
name String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shortName String
finalinherited

Methods

calc(List<KLineEntity> dataList) → void
override
drawChart(MACDEntity lastPoint, MACDEntity curPoint, double lastX, double curX, GetYFunction getY, Canvas canvas, KChartColors chartColors) → void
override
drawFigure(MACDEntity entity, int precision, KChartColors chartColors) TextSpan?
override
drawVerticalText({required Canvas canvas, required TextStyle style, required double maxValue, required double minValue, required int fixedLength, required Rect chartRect}) → void
override
formatNumber(double value, int precision) String
inherited
getMaxMinValue(KLineEntity entity, double minV, double maxV) → (double, double)
record.$1 : min value record.$2: max value
override
getTextStyle(Color? color) TextStyle
text format
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited