diff --git a/Algorithm/QCAlgorithm.Indicators.cs b/Algorithm/QCAlgorithm.Indicators.cs index a00526d5bf45..f17ea893390a 100644 --- a/Algorithm/QCAlgorithm.Indicators.cs +++ b/Algorithm/QCAlgorithm.Indicators.cs @@ -53,7 +53,8 @@ public partial class QCAlgorithm "IsReady", "Window", "Item", - "WarmUpPeriod" + "WarmUpPeriod", + "Period" }; /// diff --git a/Tests/Research/QuantBookHistoryTests.cs b/Tests/Research/QuantBookHistoryTests.cs index e4feb70ef72a..5f66ce9c50af 100644 --- a/Tests/Research/QuantBookHistoryTests.cs +++ b/Tests/Research/QuantBookHistoryTests.cs @@ -813,6 +813,32 @@ def get_history(): } } + [Test] + public void IndicatorHistoryDoesNotReturnPeriodColumn() + { + using (Py.GIL()) + { + var testModule = PyModule.FromString("testModule", + @" +from AlgorithmImports import * + +def get_indicator_history(): + qb = QuantBook() + qb.set_start_date(2014, 4, 8) + symbol = qb.add_equity(""AAPL"", Resolution.DAILY).symbol + history = qb.indicator(ValueAtRisk(252, 0.95), symbol, 365, Resolution.DAILY) + return history +"); + dynamic getHistory = testModule.GetAttr("get_indicator_history"); + var pyHistory = getHistory() as PyObject; + var columns = pyHistory.GetAttr("columns") + .InvokeMethod("tolist") + .AsManagedObject(typeof(List)) as List; + Assert.IsFalse(columns.Contains("period")); + Assert.AreEqual(1, columns.Count); + } + } + private class TestHistoryProvider : HistoryProviderBase { private IHistoryProvider _provider;