Keyword mapping refactoring
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user