Skip to content

Commit a0c67e5

Browse files
committed
Simplified candlestick indexing logic in EngineV9 by consolidating conditions.
1 parent 8836c55 commit a0c67e5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Backtest.Net/Engines/EngineV9.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,8 @@ private Task IncrementIndexes(List<SymbolDataV2> symbolData)
186186
continue;
187187

188188
TimeframeV2 tf = timeframes[i];
189-
if (tf.Index >= tf.StartIndex && tf.Index < tf.EndIndex)
190-
{
191-
if (tf.Candlesticks[tf.Index].CloseTime < referenceTime)
192-
{
193-
tf.Index++;
194-
}
195-
}
189+
if (tf.Index >= tf.StartIndex && tf.Index < tf.EndIndex &&
190+
tf.Candlesticks[tf.Index].CloseTime < referenceTime) tf.Index++;
196191
}
197192
});
198193

0 commit comments

Comments
 (0)