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

Stc Bug - Out of range exception #1107

Closed
MhAllan opened this issue Nov 4, 2023 · 3 comments · Fixed by #1108
Closed

Stc Bug - Out of range exception #1107

MhAllan opened this issue Nov 4, 2023 · 3 comments · Fixed by #1108
Labels
bug Something isn't working

Comments

@MhAllan
Copy link

MhAllan commented Nov 4, 2023

Stc throwing out of range exception when the candles are 58 candle using it's default parameters. Any number before or after 58 looks ok.

[Fact]
public void Stc_Success()
{
    var candles = RandomCandles(58).ToArray();
    var cts = candles.GetStc().Where(x => x.Stc != null).ToArray();

    Assert.True(true);
}

static IEnumerable<Quote> RandomCandles(int count)
{
    var rnd = new Random();
    for (int i = 0; i < count; i++)
    {
        yield return new Quote
        {
            Open = rnd.NextDecimal(100, 200),
            Close = rnd.NextDecimal(100, 200),
            High = rnd.NextDecimal(100, 200),
            Low = rnd.NextDecimal(100, 200),
            Date = DateTime.Now.AddDays(i)
        };
    }
}
@MhAllan MhAllan added the bug Something isn't working label Nov 4, 2023
@DaveSkender DaveSkender moved this from Maybe to Do Next in Stock Indicators for .NET Nov 4, 2023
@DaveSkender DaveSkender moved this from Do Next to In Progress in Stock Indicators for .NET Nov 4, 2023
DaveSkender added a commit that referenced this issue Nov 4, 2023
@DaveSkender DaveSkender linked a pull request Nov 4, 2023 that will close this issue
7 tasks
@github-project-automation github-project-automation bot moved this from In Progress to Done in Stock Indicators for .NET Nov 4, 2023
@MhAllan
Copy link
Author

MhAllan commented Nov 5, 2023

Thanks for quick fix, is this shipped to the preview nuget?

@DaveSkender
Copy link
Owner

DaveSkender commented Nov 5, 2023

Thanks for quick fix, is this shipped to the preview NuGet?

I usually wait for a batch of items, but will go ahead and push this one through since it sounds like you're waiting for it. This was updated in v2.4.12 and 3.0.0-preview.1014.25

@MhAllan
Copy link
Author

MhAllan commented Nov 6, 2023

Many thanks :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants