Added some standard indicators

This commit is contained in:
Michael Schimmel
2025-07-13 16:22:46 +02:00
parent f6fff24f10
commit 6e5c0de876
6 changed files with 468 additions and 119 deletions
+5 -3
View File
@@ -2,10 +2,10 @@ unit Myc.Trade.DataArray;
interface
uses
Myc.Trade.DataPoint;
type
// A series is an array of values with the newest ite at index=0. Each series counts the total of added items since creation, but
// it actually may contain less items, because the array size is limited by the lookback parameter, when adding items.
// Series are immutable.
TMycDataArray<T> = record
private
const
@@ -21,7 +21,9 @@ type
function GetItems(Idx: Int64): T; inline;
public
constructor Create(const AChunks: TArray<TChunk>; ACount, ATotalCount: Int64);
// Add a singe item
function Add(const Data: T; Lookback: Int64): TMycDataArray<T>; overload;
// Add a ranmge of items
function Add(const Data: array of T; First, Count, Lookback: Int64): TMycDataArray<T>; overload;
class function CreateEmpty: TMycDataArray<T>; static;
// Helper to create a data array from a raw TArray.