YOUSEFUL / DELPHI / COMPONENTS

EAtlasFinError

The exception Atlas Fin raises for invalid bars, CSV text, periods, zoom factors and export requests.

Class Unit Atlas.FinData · Inherits Exception · Product Atlas Fin

Description

The one exception family callers of Atlas Fin need to catch. Invalid bars and CSV rows, indicator periods outside 1..100000, a fast MACD period not below the slow one, band deviations outside 0..100, a zoom factor that is not positive, an image size outside 1..16384 and an unsupported export format all raise it. Errors from the Atlas Plot drawing layer during SaveToFile are translated into it. Whatever raised it has changed nothing. Errors from the RTL, such as an index out of range, keep their own classes.

This type has no members of its own beyond those listed in its description.

Examples

Report a rejected import

LoadCSV names the offending line in the message and leaves the series untouched.

pascal
uses System.SysUtils, Vcl.Dialogs, Atlas.FinData;

function TryLoad(Data: TAtlasBarSeries; const Text: string): Boolean;
begin
  try
    Data.LoadCSV(Text);
    Result := True;
  except
    on E: EAtlasFinError do
    begin
      ShowMessage('Prices not loaded: ' + E.Message);   // for example "CSV line 7: Low must not be above Open or Close"
      Result := False;
    end;
  end;
end;

TAtlasBarSeries · TAtlasFinChart

Also in Atlas Fin

TAtlasFinChart