Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdentityDataConsolidator Does Not Handle Fill Forward Correctly #8392

Closed
4 tasks
AlexCatarino opened this issue Nov 4, 2024 · 0 comments · Fixed by #8412
Closed
4 tasks

IdentityDataConsolidator Does Not Handle Fill Forward Correctly #8392

AlexCatarino opened this issue Nov 4, 2024 · 0 comments · Fixed by #8412
Assignees
Labels

Comments

@AlexCatarino
Copy link
Member

Expected Behavior

IdentityDataConsolidator does not call OnDataConsolidated on fill forward data.

Actual Behavior

IdentityDataConsolidator uses _last.EndTime != data.EndTime which doesn't handle fill forward data.

Potential Solution

N/A

Reproducing the Problem

The EMA is updated every minute despite QQQ uses daily data. QQQ is fill forwarded because of SPY.

namespace QuantConnect.Algorithm.CSharp
{
    public class BasicTemplateAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
    {
        private Symbol _spy = QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA);
        private ExponentialMovingAverage _ema;

        public override void Initialize()
        {
            SetStartDate(2013, 10, 07);  //Set Start Date
            SetEndDate(2013, 10, 11);    //Set End Date
            SetCash(100000);             //Set Strategy Cash

            AddEquity("SPY", Resolution.Minute);
            AddEquity("QQQ", Resolution.Daily);
            _ema = EMA("QQQ", 200, Resolution.Daily);
            WarmUpIndicator("QQQ", _ema);
        }

        public override void OnData(Slice slice)
        {
            if (slice.Bars.TryGetValue("QQQ", out var bar))
            {
                Log($"ema: {_ema.Current.Value} samples: {_ema.Samples} qqq: {bar.Close}; {bar.EndTime}");
            }
        }

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants