Login Page - Create Account

Support Board


Date/Time: Mon, 16 Sep 2024 19:08:55 +0000



Post From: View charts when not connected

[2024-06-13 20:42:46]
gtaranti - Posts: 63
I have created a custom study which automates my backtests through the use of sc.StartChartReplayNew(ReplayParameters) and appropriate replay parameters

n_ACSIL::s_ChartReplayParameters ReplayParameters;
ReplayParameters.ChartNumber = sc.ChartNumber;
ReplayParameters.ReplaySpeed = 200000;
ReplayParameters.StartDateTime = sc.BaseDateTimeIn[0];
ReplayParameters.SkipEmptyPeriods = 0;
ReplayParameters.ReplayMode = n_ACSIL::REPLAY_MODE_CALCULATE_AT_EVERY_TICK;
ReplayParameters.ClearExistingTradeSimulationDataForSymbolAndTradeAccount = 1;
ReplayParameters.ChartsToReplay = n_ACSIL::CHARTS_TO_REPLAY_ALL_CHARTS_IN_CHARTBOOK;
ReplayParameters.ProcessingStepInSeconds = 5;
sc.StartChartReplayNew(ReplayParameters);
Ofcourse I use the sc.IsChartDataLoadingCompleteForAllCharts() and sc.isReplayRunning() conditions before starting the next backtest.

The study is very simple.
In every backtest (replay) run it will only change the inputs of the study that is being backtested.

NQ 100 - CME
Data service : SC Data - ALL Services
For demonstration purposes I have limited the loaded time period to 10 days.

I have noticed that when the ProcessingStepInSeconds >= 5 there is no problem.
Every backtest(replay) runs after the other, and no message is showing between them. Actually each backtest starts imediatelly after the previous has ended.

If the ProcessingStepInSeconds == 1 then after the first backtest ends the message "Downloading Continuous Contract Data" appears.

If you need the full study code I can provide it. (~150 LOC)
Date Time Of Last Edit: 2024-06-13 20:43:46