TDataPoint<T> review
This commit is contained in:
@@ -117,8 +117,8 @@ type
|
||||
FDescriptionText: string; // User-friendly description
|
||||
public
|
||||
constructor Create(ATickCount: Integer);
|
||||
function Init(const ADataSet: TArray<TDataRecord<TAskBidItem>>): Boolean;
|
||||
function IsNewBar(AIndex: Integer; const ATick: TDataRecord<TAskBidItem>): Boolean;
|
||||
function Init(const ADataSet: TArray<TDataPoint<TAskBidItem>>): Boolean;
|
||||
function IsNewBar(AIndex: Integer; const ATick: TDataPoint<TAskBidItem>): Boolean;
|
||||
function GetCaption: string; // Returns the Description for UI
|
||||
property Caption: string read GetCaption; // Interface property uses GetCaption
|
||||
end;
|
||||
@@ -130,8 +130,8 @@ type
|
||||
FDescriptionText: string; // User-friendly description
|
||||
public
|
||||
constructor Create(ATargetTickVolume: Integer);
|
||||
function Init(const ADataSet: TArray<TDataRecord<TAskBidItem>>): Boolean;
|
||||
function IsNewBar(AIndex: Integer; const ATick: TDataRecord<TAskBidItem>): Boolean;
|
||||
function Init(const ADataSet: TArray<TDataPoint<TAskBidItem>>): Boolean;
|
||||
function IsNewBar(AIndex: Integer; const ATick: TDataPoint<TAskBidItem>): Boolean;
|
||||
function GetCaption: string; // Returns the Description for UI
|
||||
property Caption: string read GetCaption; // Interface property uses GetCaption
|
||||
end;
|
||||
@@ -147,12 +147,12 @@ begin
|
||||
FDescriptionText := Format('Every %d Ticks', [FTickCountForNewBar]);
|
||||
end;
|
||||
|
||||
function TEveryNTicksBuilder.Init(const ADataSet: TArray<TDataRecord<TAskBidItem>>): Boolean;
|
||||
function TEveryNTicksBuilder.Init(const ADataSet: TArray<TDataPoint<TAskBidItem>>): Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function TEveryNTicksBuilder.IsNewBar(AIndex: Integer; const ATick: TDataRecord<TAskBidItem>): Boolean;
|
||||
function TEveryNTicksBuilder.IsNewBar(AIndex: Integer; const ATick: TDataPoint<TAskBidItem>): Boolean;
|
||||
begin
|
||||
Result := (AIndex mod FTickCountForNewBar = 0);
|
||||
end;
|
||||
@@ -173,13 +173,13 @@ begin
|
||||
FCurrentTickInBarCount := 0;
|
||||
end;
|
||||
|
||||
function TVolumeAccumulationBuilder.Init(const ADataSet: TArray<TDataRecord<TAskBidItem>>): Boolean;
|
||||
function TVolumeAccumulationBuilder.Init(const ADataSet: TArray<TDataPoint<TAskBidItem>>): Boolean;
|
||||
begin
|
||||
FCurrentTickInBarCount := 0;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function TVolumeAccumulationBuilder.IsNewBar(AIndex: Integer; const ATick: TDataRecord<TAskBidItem>): Boolean;
|
||||
function TVolumeAccumulationBuilder.IsNewBar(AIndex: Integer; const ATick: TDataPoint<TAskBidItem>): Boolean;
|
||||
begin
|
||||
Inc(FCurrentTickInBarCount);
|
||||
if FCurrentTickInBarCount >= FTargetTickVolumePerBar then
|
||||
@@ -755,8 +755,8 @@ begin
|
||||
and (HoveredCandle.OriginalDataIndexEnd >= 0)
|
||||
and (HoveredCandle.OriginalDataIndexEnd < FDataController.GetTickDataLength) then // Use GetTickDataLength
|
||||
begin
|
||||
UTCTimeStart := FDataController.GetTickDataItem(HoveredCandle.OriginalDataIndexStart).TimeStamp;
|
||||
UTCTimeEnd := FDataController.GetTickDataItem(HoveredCandle.OriginalDataIndexEnd).TimeStamp;
|
||||
UTCTimeStart := FDataController.GetTickDataItem(HoveredCandle.OriginalDataIndexStart).Time;
|
||||
UTCTimeEnd := FDataController.GetTickDataItem(HoveredCandle.OriginalDataIndexEnd).Time;
|
||||
LocalTimeStart := TTimeZone.Local.ToLocalTime(UTCTimeStart);
|
||||
LocalTimeEnd := TTimeZone.Local.ToLocalTime(UTCTimeEnd);
|
||||
TimeZoneStr := TTimeZone.Local.GetAbbreviation(LocalTimeStart); // Get abbreviation for the local time zone
|
||||
@@ -1299,7 +1299,7 @@ begin
|
||||
if (CrosshairCandle.OriginalDataIndexStart >= 0)
|
||||
and (CrosshairCandle.OriginalDataIndexStart < FDataController.GetTickDataLength) then // Use GetTickDataLength
|
||||
begin
|
||||
UTCTimeStart := FDataController.GetTickDataItem(CrosshairCandle.OriginalDataIndexStart).TimeStamp;
|
||||
UTCTimeStart := FDataController.GetTickDataItem(CrosshairCandle.OriginalDataIndexStart).Time;
|
||||
LocalTimeStart := TTimeZone.Local.ToLocalTime(UTCTimeStart);
|
||||
TimeStr := FormatDateTime('hh:nn:ss', LocalTimeStart); // Display time part
|
||||
|
||||
|
||||
Reference in New Issue
Block a user