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

Same Value for Correlation Indicator for Pearson and Spearman #8423

Closed
4 tasks done
superichmann opened this issue Nov 22, 2024 · 1 comment · Fixed by #8426
Closed
4 tasks done

Same Value for Correlation Indicator for Pearson and Spearman #8423

superichmann opened this issue Nov 22, 2024 · 1 comment · Fixed by #8426
Labels

Comments

@superichmann
Copy link

Expected Behavior

When initializing Correlation indicator with CorrelationType.Pearson the output value of the indicator should be different then when initializing it with CorrelationType.Spearman

Actual Behavior

The same value is outputted by the indicator (Pearson I guess).

Potential Solution

Actually do really yes implement both of the correlation type or remove this option completely.

Reproducing the Problem

namespace QuantConnect.Algorithm.CSharp
{
    public class corrnogood : QCAlgorithm
    {
        Correlation cp;
        Correlation cs;
        public override void Initialize()
        {
            SetStartDate(2023, 1, 1);
            var symbol=AddEquity("AAPL", Resolution.Daily).Symbol;
            var spy=AddEquity("SPY", Resolution.Daily).Symbol;
            cp=C(symbol, spy, 5, CorrelationType.Pearson);
            cs=C(symbol, spy, 5, CorrelationType.Spearman);
            cp.Window.Size=1000;
            cs.Window.Size=1000;
        }

        public override void OnData(Slice data)
        {
            if (data.Bars.ContainsKey("AAPL"))
            {
            if (cp.IsReady)
            {
                Plot("PLOTPLZ","cp",cp);
                Plot("PLOTPLZ","cs",cs);
            }
            }
        }

    }
}

System Information

qc cloud

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
@Martin-Molinero
Copy link
Member

Thank you for the report @superichmann, seems there's a typo and we are missing to pass through the correlation type, we will fix it asap

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.

3 participants