Add History method overload For Python (#6265)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled

* Add requested History overload

* Add more regression tests

* Revert "Add more regression tests"

This reverts commit 71b279e917629c3d5ed577e39aec74149b052afb.

* Add more regression tests
This commit is contained in:
Ricardo Andrés Marino Rojas
2022-03-30 14:18:36 -05:00
committed by GitHub
parent cc18e47cd6
commit 85eb1fca9a
2 changed files with 36 additions and 0 deletions
+17
View File
@@ -860,6 +860,23 @@ namespace QuantConnect.Algorithm
return PandasConverter.GetDataFrame(History(symbols, span, resolution));
}
/// <summary>
/// Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.
/// </summary>
/// <param name="symbols">The symbols to retrieve historical data for</param>
/// <param name="start">The start time in the algorithm's time zone</param>
/// <param name="end">The end time in the algorithm's time zone</param>
/// <param name="resolution">The resolution to request</param>
/// <param name="fillForward">True to fill forward missing data, false otherwise</param>
/// <param name="extendedMarket">True to include extended market hours data, false otherwise</param>
/// <returns>A python dictionary with a pandas DataFrame containing the requested historical data</returns>
[DocumentationAttribute(HistoricalData)]
public PyObject History(PyObject tickers, DateTime start, DateTime end, Resolution? resolution = null, bool? fillForward = null, bool? extendedMarket = null)
{
var symbols = tickers.ConvertToSymbolEnumerable();
return PandasConverter.GetDataFrame(History(symbols, start, end, resolution, fillForward, extendedMarket));
}
/// <summary>
/// Gets the historical data for the specified symbol between the specified dates. The symbol must exist in the Securities collection.
/// </summary>