Keyword mapping refactoring

This commit is contained in:
Michael Schimmel
2025-12-09 12:59:36 +01:00
parent 43afbd6050
commit f8dc5b945c
13 changed files with 257 additions and 188 deletions
+7 -3
View File
@@ -55,6 +55,7 @@ uses
Myc.FMX.Chart,
Myc.Trade.Indicators,
Myc.Trade.Indicators.Common,
Myc.Core.FileCache,
Myc.Trade.DataFeed,
StrategyTest,
TestMethodCallFromRecordParams;
@@ -114,6 +115,7 @@ type
FProcessDone: TState;
FApplication: IAuraApplication;
FModulesItem: TTreeViewItem;
FFileCache: IDataFileCache<TArray<TScalarRecordFeed.TBatch>>;
FFeed: IScalarRecordFeed;
function SelectedSymbol: String;
procedure ExecuteStrategy(const Symbol: String; Timeframe: TTimeframe; const Consumer: IConsumer<TDataPoint<TOhlcItem>>);
@@ -195,6 +197,8 @@ procedure TForm1.FormCreate(Sender: TObject);
begin
FApplication := TMycAuraApplication.Create;
FFileCache := TDataFileCache<TArray<TScalarRecordFeed.TBatch>>.Create;
FModulesItem := TTreeViewItem.Create(Self);
FModulesItem.Text := 'Modules';
@@ -382,15 +386,15 @@ begin
var terminated := TFlag.CreateObserver(FTerminate.Signal).State;
var path := '\\COFFEE\TickData\Pepperstone'; // Or FServer.Path if compatible
FFeed := TScalarRecordFeed.Create(path, '.m1', true, def);
FFeed := TScalarRecordFeed.Create(FFileCache, path, '.m1', true, def);
// Converter: Transforms raw IRecordSeries (Columns) into TArray<TDataPoint>
var ticker :=
FFeed.Ticker.Chain<TDataPoint<Double>>(
function(const Tick: IScalarRecord): TDataPoint<Double>
begin
Result.Time := Tick.ItemByIndex(iTime).Value.AsDouble;
Result.Data := Tick.ItemByIndex(iClose).Value.AsDouble;
Result.Time := Tick[iTime].Value.Value.AsDouble;
Result.Data := Tick[iClose].Value.Value.AsDouble;
end
);