@@ -44,18 +44,16 @@ public class InRunResultsAnalyzer : ResultsAnalyzer
4444
4545 private readonly AlgorithmSpeedTracker _speed = new ( ) ;
4646
47- private readonly QCAlgorithm _algorithm ;
48-
4947 /// <summary>
5048 /// The number of order events already consumed by previous runs. The order events
51- /// in the result passed to <see cref="Run(Result, IReadOnlyList{string}, int, int)"/>
49+ /// in the result passed to <see cref="Run(Result, IReadOnlyList{string}, System.Nullable{AlgorithmSpeedSample}, int, int)"/>
5250 /// are expected to start at this position.
5351 /// </summary>
5452 public int OrderEventsPosition { get ; private set ; }
5553
5654 /// <summary>
5755 /// The number of log entries already consumed by previous runs. The logs passed to
58- /// <see cref="Run(Result, IReadOnlyList{string}, int, int)"/> are expected to start
56+ /// <see cref="Run(Result, IReadOnlyList{string}, System.Nullable{AlgorithmSpeedSample}, int, int)"/> are expected to start
5957 /// at this position.
6058 /// </summary>
6159 public int LogsPosition { get ; private set ; }
@@ -76,14 +74,13 @@ public class InRunResultsAnalyzer : ResultsAnalyzer
7674 /// <summary>
7775 /// Initializes a new instance of the <see cref="InRunResultsAnalyzer"/> class.
7876 /// The instance is expected to be kept alive for the duration of the backtest,
79- /// receiving fresh data on each <see cref="Run(Result, IReadOnlyList{string}, int, int)"/> call.
77+ /// receiving fresh data on each <see cref="Run(Result, IReadOnlyList{string}, System.Nullable{AlgorithmSpeedSample}, int, int)"/> call.
8078 /// </summary>
8179 /// <param name="algorithm">The algorithm instance used for history requests and settings.</param>
8280 /// <param name="language">The programming language the algorithm is written in.</param>
8381 public InRunResultsAnalyzer ( QCAlgorithm algorithm , Language language )
8482 : base ( null , algorithm , language , null )
8583 {
86- _algorithm = algorithm ;
8784 }
8885
8986 /// <summary>
@@ -94,25 +91,17 @@ public InRunResultsAnalyzer(QCAlgorithm algorithm, Language language)
9491 /// Findings from analyses scanning the order event and log streams are accumulated
9592 /// (first sample kept, counts totaled), while findings from state-based analyses are
9693 /// replaced on every run.
97- /// While the algorithm is warming up, nothing is analyzed or consumed and no findings are reported.
9894 /// </summary>
9995 /// <param name="result">A snapshot of the current intermediate backtest result, holding only new order events.</param>
10096 /// <param name="logs">The log lines produced since the previous run.</param>
101- /// <param name="speedSample">A sample of the engine speed counters for the algorithm speed analysis, when available.</param>
97+ /// <param name="speedSample">A sample of the engine speed counters for the algorithm speed analysis.
98+ /// Null when the counters should not be sampled, like while the algorithm warms up.</param>
10299 /// <param name="timeLimitSeconds">Wall-clock seconds allowed for the full chain before early exit.</param>
103100 /// <param name="maxFailedAnalyses">Maximum number of failing analyses to return.</param>
104101 /// <returns>The accumulated findings, ranked by analysis weight.</returns>
105102 public IReadOnlyList < QuantConnect . Analysis > Run ( Result result , IReadOnlyList < string > logs , AlgorithmSpeedSample ? speedSample = null ,
106103 int timeLimitSeconds = 1 , int maxFailedAnalyses = 10 )
107104 {
108- // Nothing is analyzed during the algorithm warm-up period: trading hasn't started, and
109- // sampling the warm-up pace would skew the speed metrics. The positions don't advance,
110- // so the order events and logs produced during warm-up are analyzed by the first run after it ends.
111- if ( _algorithm ? . IsWarmingUp == true )
112- {
113- return [ ] ;
114- }
115-
116105 SetAnalysisData ( result , logs ) ;
117106 if ( speedSample . HasValue )
118107 {
0 commit comments