Sample SMA strategy

This commit is contained in:
Michael Schimmel
2025-09-03 19:32:46 +02:00
parent 696fb2f9a0
commit 48bc763e41
3 changed files with 21 additions and 20 deletions
+3 -3
View File
@@ -664,7 +664,7 @@ end;
procedure TForm1.OHLCButtonClick(Sender: TObject);
const
numRecs = 100;
numRecs = 1000;
lookback = 50;
smaSlowLength = 20;
smaFastLength = 5;
@@ -827,8 +827,8 @@ begin
FGScope.SetValue('current_series', TAstValue.FromRecordSeries(series));
resultValue := callAst.Accept(visitor);
Memo1.Lines.Add(Format('Tick %d/%d: Close = %.2f, Signal = %s', [i, numRecs, ohlcvRec.Close, resultValue.ToString]));
Application.ProcessMessages;
// Memo1.Lines.Add(Format('Tick %d/%d: Close = %.2f, Signal = %s', [i, numRecs, ohlcvRec.Close, resultValue.ToString]));
// Application.ProcessMessages;
end;
end;