Add data mapping mode parameter to QCAlgorithm.History() (#6415)
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled

* Add dataMappingMode parameter to QCAlgorithm.History()

* Add C# regression algorithm

* Add Python regression algorithm

* Cleanup

* Add data mapping mode parameter only to big History() methods

* Fix regression algorithms and add required data

* Fix unit test

* Update regression algorithms stats
This commit is contained in:
Jhonathan Abreu
2022-06-22 18:25:30 -04:00
committed by GitHub
parent a12a43c1ef
commit 505ef17565
10 changed files with 305 additions and 27 deletions
+5 -3
View File
@@ -870,18 +870,20 @@ namespace QuantConnect.Algorithm
/// <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="tickers">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>
/// <param name="dataMappingMode">The contract mapping mode to use for the security history request</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)
public PyObject History(PyObject tickers, DateTime start, DateTime end, Resolution? resolution = null, bool? fillForward = null,
bool? extendedMarket = null, DataMappingMode? dataMappingMode = null)
{
var symbols = tickers.ConvertToSymbolEnumerable();
return PandasConverter.GetDataFrame(History(symbols, start, end, resolution, fillForward, extendedMarket));
return PandasConverter.GetDataFrame(History(symbols, start, end, resolution, fillForward, extendedMarket, dataMappingMode));
}
/// <summary>