YOUSEFUL / DELPHI / COMPONENTS

TAtlasMacd

The three lines TAtlasIndicators.MACD returns.

Record Unit Atlas.FinIndicators · Product Atlas Fin

Description

Each array is as long as the input. With periods 12, 26, 9, Line starts at index 25 and Signal and Histogram at index 33.

Members

MemberKindWhat it does
LinefieldEMA(Fast) minus EMA(Slow).
SignalfieldEMA(Signal) of Line.
HistogramfieldLine minus Signal.

Fields

Line field

Line, Signal, Histogram: TArray<Double>;

EMA(Fast) minus EMA(Slow).

Signal field

Line, Signal, Histogram: TArray<Double>;

EMA(Signal) of Line.

Histogram field

Line, Signal, Histogram: TArray<Double>;

Line minus Signal.

Examples

Is momentum rising?

True when the newest MACD histogram value is positive and larger than the one before.

pascal
uses System.Math, Atlas.FinIndicators;

function MomentumRising(const Closes: TArray<Double>): Boolean;
var
  M: TAtlasMacd;
  N: Integer;
begin
  Result := False;
  N := Length(Closes);
  if N < 2 then Exit;
  M := TAtlasIndicators.MACD(Closes, 12, 26, 9);
  Result := not IsNan(M.Histogram[N - 2]) and (M.Histogram[N - 1] > 0) and (M.Histogram[N - 1] > M.Histogram[N - 2]);
end;

TAtlasIndicators

Also in Atlas Fin

TAtlasFinChart