Skip to content

Commit

Permalink
remove default value for StarcBands (#1046)
Browse files Browse the repository at this point in the history
Co-authored-by: Dave Skender <8432125+DaveSkender@users.noreply.github.com>
  • Loading branch information
Temppus and DaveSkender authored Apr 18, 2023
1 parent 09dc9fa commit 7c7495e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
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
.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

0 comments on commit 7c7495e

Please sign in to comment.