diff --git a/Indicators/CandlestickPatterns/AbandonedBaby.cs b/Indicators/CandlestickPatterns/AbandonedBaby.cs
index 0e0f95417dd0..c74aab3add03 100644
--- a/Indicators/CandlestickPatterns/AbandonedBaby.cs
+++ b/Indicators/CandlestickPatterns/AbandonedBaby.cs
@@ -90,6 +90,11 @@ public override bool IsReady
get { return Samples > Period; }
}
+ ///
+ /// Required period, in data points, for the indicator to be ready and fully initialized.
+ ///
+ public override int WarmUpPeriod => Period + 1;
+
///
/// Computes the next value of this indicator from the given state
///
diff --git a/Indicators/CandlestickPatterns/MatHold.cs b/Indicators/CandlestickPatterns/MatHold.cs
index 51d72c3646b0..1f38702f0952 100644
--- a/Indicators/CandlestickPatterns/MatHold.cs
+++ b/Indicators/CandlestickPatterns/MatHold.cs
@@ -85,6 +85,11 @@ public override bool IsReady
get { return Samples > Period; }
}
+ ///
+ /// Required period, in data points, for the indicator to be ready and fully initialized.
+ ///
+ public override int WarmUpPeriod => Period + 1;
+
///
/// Computes the next value of this indicator from the given state
///
diff --git a/Indicators/CandlestickPatterns/RiseFallThreeMethods.cs b/Indicators/CandlestickPatterns/RiseFallThreeMethods.cs
index 6327a7d5a5eb..ec3bb6b1c6be 100644
--- a/Indicators/CandlestickPatterns/RiseFallThreeMethods.cs
+++ b/Indicators/CandlestickPatterns/RiseFallThreeMethods.cs
@@ -67,6 +67,11 @@ public override bool IsReady
get { return Samples > Period; }
}
+ ///
+ /// Required period, in data points, for the indicator to be ready and fully initialized.
+ ///
+ public override int WarmUpPeriod => Period + 1;
+
///
/// Computes the next value of this indicator from the given state
///
diff --git a/Tests/Indicators/CandlestickPatterns/CandlestickPatternTests.cs b/Tests/Indicators/CandlestickPatterns/CandlestickPatternTests.cs
index 557564d71118..4671dc07ce70 100644
--- a/Tests/Indicators/CandlestickPatterns/CandlestickPatternTests.cs
+++ b/Tests/Indicators/CandlestickPatterns/CandlestickPatternTests.cs
@@ -153,6 +153,24 @@ public void ResetsProperly(CandlestickPattern indicator, string columnName, stri
TestHelper.TestIndicatorReset(indicator, testFileName);
}
+ [Test, TestCaseSource(nameof(PatternTestParameters))]
+ public void WarmsUpProperly(CandlestickPattern indicator, string columnName, string testFileName)
+ {
+ // the sample count below only means anything from a known starting point
+ indicator.Reset();
+
+ var period = indicator.WarmUpPeriod;
+ var startDate = new DateTime(2019, 1, 1);
+
+ for (var i = 0; i < period; i++)
+ {
+ indicator.Update(new TradeBar(startDate.AddDays(i), Symbols.SPY, 100m + i, 105m + i, 95m + i, 100m + i, 100m, Time.OneDay));
+ Assert.AreEqual(i == period - 1, indicator.IsReady);
+ }
+
+ Assert.AreEqual(period, indicator.Samples);
+ }
+
private static Action, double> Assertion
{
get