Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Algorithm/QCAlgorithm.Indicators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public partial class QCAlgorithm
"IsReady",
"Window",
"Item",
"WarmUpPeriod"
"WarmUpPeriod",
"Period"
};

/// <summary>
Expand Down
26 changes: 26 additions & 0 deletions Tests/Research/QuantBookHistoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>)) as List<string>;
Assert.IsFalse(columns.Contains("period"));
Assert.AreEqual(1, columns.Count);
}
}

private class TestHistoryProvider : HistoryProviderBase
{
private IHistoryProvider _provider;
Expand Down
Loading