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

Remove default value for StarcBands #1046

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/_common/ObsoleteV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public static partial class Indicator
[Obsolete("Rename 'ToTupleCollection(..)' to 'ToTupleChainable(..)' to fix.", false)]
public static Collection<(DateTime Date, double Value)> ToTupleCollection(
this IEnumerable<IReusableResult> reusable)
=> reusable
.ToTupleChainable();
=> reusable
.ToTupleChainable();

[ExcludeFromCodeCoverage]
[Obsolete("Rename 'ToTupleCollection(NullTo..)' to either 'ToTupleNaN(..)' or 'ToTupleNull(..)' to fix.", false)]
Expand All @@ -50,6 +50,14 @@ public static partial class Indicator
return results;
}

// v2.4.10
[ExcludeFromCodeCoverage]
[Obsolete("Change 'GetStarcBands()' to 'GetStarcBands(20)' to fix.", false)]
public static IEnumerable<StarcBandsResult> GetStarcBands<TQuote>(
this IEnumerable<TQuote> quotes)
where TQuote : IQuote
=> quotes.GetStarcBands(20);

#pragma warning restore CA1002 // Do not expose generic lists
}

Expand Down
2 changes: 1 addition & 1 deletion src/s-z/StarcBands/StarcBands.Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static partial class Indicator
///
public static IEnumerable<StarcBandsResult> GetStarcBands<TQuote>(
this IEnumerable<TQuote> quotes,
int smaPeriods = 20,
int smaPeriods,
double multiplier = 2,
int atrPeriods = 10)
where TQuote : IQuote => quotes
Expand Down
4 changes: 2 additions & 2 deletions tests/indicators/s-z/StarcBands/StarcBands.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public void BadData()
public void NoQuotes()
{
List<StarcBandsResult> r0 = noquotes
DaveSkender marked this conversation as resolved.
Show resolved Hide resolved
.GetStarcBands()
.GetStarcBands(10)
.ToList();

Assert.AreEqual(0, r0.Count);

List<StarcBandsResult> r1 = onequote
.GetStarcBands()
.GetStarcBands(10)
.ToList();

Assert.AreEqual(1, r1.Count);
Expand Down
2 changes: 1 addition & 1 deletion tests/performance/Perf.Indicators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public object GetEmaStream()
public object GetSmma() => h.GetSmma(10);

[Benchmark]
public object GetStarcBands() => h.GetStarcBands();
public object GetStarcBands() => h.GetStarcBands(10);

[Benchmark]
public object GetStc() => h.GetStc();
Expand Down