YOUSEFUL / DELPHI / COMPONENTS

TAtlasFinStudies

The collection behind TAtlasFinPane.Studies: what a pane draws, in drawing order.

Class Unit Atlas.FinChart · Inherits TOwnedCollection · Product Atlas Fin

Description

An owned collection of TAtlasFinStudy items with the usual TCollection members (Count, Clear, Delete, BeginUpdate, EndUpdate). Any change repaints the chart.

Members

MemberKindWhat it does
AddmethodAppends a study of the given kind and returns it.
ItemspropertyThe study at Index, in drawing order.

Properties

Items property

property Items[Index: Integer]: TAtlasFinStudy read GetItem; default;

The study at Index, in drawing order. Being the default property, Pane.Studies[0] is enough.

pascal
Chart.Panes[0].Studies[0].Kind := skCloseArea;

Methods

Add method

function Add(Kind: TAtlasStudyKind; Period: Integer = 0): TAtlasFinStudy;

Appends a study of the given kind and returns it. A Period of 0 takes the kind's default: 20 for SMA, EMA and Bollinger, 12 (the fast period) for MACD, 14 for RSI; the price and volume kinds ignore it. Any other period is validated like the Period property: outside 1..100000, or at 26 or more for MACD, raises EAtlasFinError, and the new item is removed again.

pascal
Pane.Studies.Add(skSMA);        // SMA(20)
Pane.Studies.Add(skEMA, 9);     // EMA(9)
Pane.Studies.Add(skRSI);        // RSI(14)

Examples

List the studies of a chart

Walks every pane and study and collects the captions the headers show.

pascal
uses System.Classes, Atlas.FinChart;

procedure ListStudies(Chart: TAtlasFinChart; Target: TStrings);
var
  I, J: Integer;
begin
  for I := 0 to Chart.Panes.Count - 1 do
    for J := 0 to Chart.Panes[I].Studies.Count - 1 do
      Target.Add(Chart.Panes[I].Title + ': ' + Chart.Panes[I].Studies[J].Caption);
end;

TAtlasFinStudy · TAtlasFinPane

Also in Atlas Fin

TAtlasFinChart