Scope cells refactoring

This commit is contained in:
Michael Schimmel
2025-09-05 12:46:24 +02:00
parent edf8329b28
commit 100646c7d8
5 changed files with 61 additions and 117 deletions
+3 -3
View File
@@ -394,7 +394,7 @@ end;
procedure TForm1.OHLCButtonClick(Sender: TObject);
const
numRecs = 100;
numRecs = 1000;
lookback = 50;
smaSlowLength = 20;
smaFastLength = 10;
@@ -561,12 +561,12 @@ begin
if series.AsRecordSeries.Value.TotalCount >= smaSlowLength then
begin
// Update the 'current_series' value in the scope using the FAST index-based assignment
scope[seriesAddress] := series;
scope[seriesAddress].Value := series;
// Execute the PRE-BOUND call AST
var resultValue := callAst.Accept(visitor);
if i < smaSlowLength + 50 then
if i mod 50 = 0 then
begin
Memo1.Lines.Add(Format('Tick %d/%d: Close = %.2f, Signal = %s', [i, numRecs, ohlcvRec.Close, resultValue.ToString]));
Application.ProcessMessages;