diff --git a/ChartDisplay/ChartDisplayMain.pas b/ChartDisplay/ChartDisplayMain.pas index 7389e84..8b5b378 100644 --- a/ChartDisplay/ChartDisplayMain.pas +++ b/ChartDisplay/ChartDisplayMain.pas @@ -259,6 +259,24 @@ var BuilderNCaptionKey, BuilderVCaptionKey: string; // These will be the unique keys BuilderNDescription, BuilderVDescription: string; begin + IsMemoryLow := + function: Boolean + var + memStatusEx: TMemoryStatusEx; + begin + memStatusEx.dwLength := SizeOf(TMemoryStatusEx); // Initialize the structure size + if GlobalMemoryStatusEx(memStatusEx) then + begin + Result := memStatusEx.dwMemoryLoad >= 80; + end + else + begin + // Handle potential error if GlobalMemoryStatusEx fails + RaiseLastOSError; + Result := False; // Or handle error as appropriate + end; + end; + FCandleWidthInPixels := InitialCandleWidth; FCandleSpacing := InitialCandleSpacing; FDisplayStartIndex := 0; @@ -447,7 +465,6 @@ var NewOptimalStartIndex, i: Integer; begin Memo.Lines.Add(FormatDateTime('yyyy-mm-dd hh:nn:ss', Now) + ' - Refresh Button clicked...'); - TargetStartTickIndex := -1; if Assigned(FActiveOHLCCache) and FActiveOHLCCache.IsValid @@ -566,10 +583,6 @@ end; procedure TChartForm.PathSelectButtonClick(Sender: TObject); var selectedDirectory: string; - fileName: string; - pathValue, symbolValue: string; - yearValue, monthValue: Integer; - i: Integer; begin selectedDirectory := DataPathEdit.Text; // Start with current path, if any // Use Vcl.FileCtrl.SelectDirectory function for directory selection. @@ -1458,7 +1471,6 @@ end; procedure TChartForm.PopulateSymbolComboBox; var - selectedDirectory: string; fileName: string; pathValue, symbolValue: string; yearValue, monthValue: Integer; diff --git a/common/Myc.OHLCCache.pas b/common/Myc.OHLCCache.pas index 7b93ffe..66e33ed 100644 --- a/common/Myc.OHLCCache.pas +++ b/common/Myc.OHLCCache.pas @@ -259,7 +259,6 @@ begin OpenPrice := ATickData[0].Data.Ask; // Changed HighPrice := ATickData[0].Data.Ask; // Changed LowPrice := ATickData[0].Data.Ask; // Changed - ClosePrice := ATickData[0].Data.Ask; // Changed for I := 0 to NumDataPoints - 1 do begin