Looking at this Alpha looks like th goal is to return between the close of the previous day to 12:00 the day after. So total 3 days. But when I look at the code that gets the history it gets historical data for only 1 day which would be just previous day like here -
var history = algorithm.History(symbols, 1, _resolution); // My question is should this be for 2 days instead ?.History(symbols, 2, _resolution);
if (symbols.Count() > 0 && history.Count() == 0)
{
algorithm.Debug($"No data on {algorithm.Time}");
}
history.PushThrough(bar =>
{
SymbolData symbolData;
if (!_symbolDataBySymbol.TryGetValue(bar.Symbol, out symbolData))
{
symbolData = new SymbolData(bar.Symbol, _predictionInterval);
}
symbolData.Update(bar.EndTime, bar.Price);
_symbolDataBySymbol[bar.Symbol] = symbolData;
});
Also SMA is for 3 days as below -
// Mean value of returns for magnitude prediction
private readonly SimpleMovingAverage _meanOfPriceChange = new RateOfChangePercent(1).SMA(3);
// Price change from close price the previous day
private readonly RateOfChangePercent _priceChange = new RateOfChangePercent(3);