YOUSEFUL / DELPHI / COMPONENTS
TAtlasBar
One price bar: time, open, high, low, close and volume.
Description
The record TAtlasBarSeries.Bars[I] returns. It is a copy: changing its fields does not change the series. Use TAtlasBarSeries.UpdateLast to change the newest bar.
Members
| Member | Kind | What it does |
|---|---|---|
Time | field | The bar's time. |
Open | field | The first price of the bar. |
High | field | The highest price; never below Open, Close or Low in a series. |
Low | field | The lowest price; never above Open or Close in a series. |
Close | field | The last price of the bar; the input of every indicator. |
Volume | field | The traded volume, zero or more; 0 when not given. |
Rising | method | True when Close >= Open. |
Methods
Rising method
function Rising: Boolean;True when Close >= Open. A flat bar counts as rising and is drawn in UpColor.
Fields
Time field
Time: TDateTime;The bar's time. The chart treats a bar with a zero time of day as daily (headers show the date only).
Open field
Open, High, Low, Close, Volume: Double;The first price of the bar.
High field
Open, High, Low, Close, Volume: Double;The highest price; never below Open, Close or Low in a series.
Low field
Open, High, Low, Close, Volume: Double;The lowest price; never above Open or Close in a series.
Close field
Open, High, Low, Close, Volume: Double;The last price of the bar; the input of every indicator.
Volume field
Open, High, Low, Close, Volume: Double;The traded volume, zero or more; 0 when not given.
Examples
Count rising days
Reads every bar of a series and counts those that closed at or above their open.
uses Atlas.FinData;
function RisingBars(Data: TAtlasBarSeries): Integer;
var
I: Integer;
begin
Result := 0;
for I := 0 to Data.Count - 1 do
if Data[I].Rising then Inc(Result);
end;