diff --git a/docs/pages/home.md b/docs/pages/home.md index b326583ee..1e80ecfdb 100644 --- a/docs/pages/home.md +++ b/docs/pages/home.md @@ -73,7 +73,7 @@ See the [guide]({{site.baseurl}}/guide/#content) and the [full list of indicator Our [NuGet library](https://www.nuget.org/packages/Skender.Stock.Indicators) directly targets all current frameworks for peak performance, including the .NET Standard for older framework compatibility. - .NET 8.0, 7.0, 6.0 -- .NET Standard 2.1, 2.0 +- .NET Standard 2.1 The compiled library package is [Common Language Specification (CLS) compliant](https://docs.microsoft.com/en-us/dotnet/standard/common-type-system) and can be used in other programming languages, including Python and everything in the .NET universe. diff --git a/src/Indicators.csproj b/src/Indicators.csproj index d78154c16..5526bee56 100644 --- a/src/Indicators.csproj +++ b/src/Indicators.csproj @@ -1,7 +1,7 @@ - net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0 + net8.0;net7.0;net6.0;netstandard2.1 Dave Skender Stock Indicators for .NET diff --git a/src/_common/ObsoleteV3.md b/src/_common/ObsoleteV3.md index 436313b31..214d50079 100644 --- a/src/_common/ObsoleteV3.md +++ b/src/_common/ObsoleteV3.md @@ -42,6 +42,8 @@ Items marked with 🚩 require special attention since they will not produc - all backwards compatible v1 accomodations removed. +- no longer supporting .NET Standard 2.0 for older .NET Framework compatibility. + - 🚩 `IReusableResult.Value` property was changed to non-nullable and returns `double.NaN` instead of `null` for incalculable periods. The standard results (e.g. `EmaResult.Ema`) continue to return `null` for incalculable periods. diff --git a/src/_common/Quotes/Quote.Models.cs b/src/_common/Quotes/Quote.Models.cs index c7eb2f592..7cc287840 100644 --- a/src/_common/Quotes/Quote.Models.cs +++ b/src/_common/Quotes/Quote.Models.cs @@ -25,7 +25,7 @@ public record class Quote : IQuote public decimal Volume { get; set; } public bool Equals(IQuote? other) - => base.Equals(other); + => base.Equals(other); } public abstract class EquatableQuote() @@ -78,8 +78,8 @@ public bool Equals(TQuote? other) && (Volume == other.Volume); } - public static bool operator ==(this, other) - // ==(EquatableQuote lhs, EquatableQuote rhs) + public static bool operator + ==(EquatableQuote lhs, EquatableQuote rhs) { if (lhs is null) { @@ -96,13 +96,13 @@ public bool Equals(TQuote? other) return lhs.Equals(rhs); } - public static bool operator !=(this, other) - // !=(EquatableQuote lhs, EquatableQuote rhs) - => !(lhs == rhs); + public static bool operator + !=(EquatableQuote lhs, EquatableQuote rhs) + => !(lhs == rhs); public override int GetHashCode() - => throw new ApplicationException("this class does not support GetHashCode"); - //=> (TickDate, Open, High, Low, Close, Volume).GetHashCode(); + => HashCode.Combine( + TickDate, Open, High, Low, Close, Volume); } internal class QuoteD diff --git a/tests/indicators/TestBase.cs b/tests/indicators/TestBase.cs index 7157eed17..712baa1b0 100644 --- a/tests/indicators/TestBase.cs +++ b/tests/indicators/TestBase.cs @@ -38,6 +38,8 @@ public abstract class SeriesTestBase : TestQuoteBase internal readonly DateTime evalDate = DateTime.ParseExact("12/31/2018", "MM/dd/yyyy", EnglishCulture); + // TODO: once caught up, make these abstract instead of virtual + [TestMethod] public virtual void Standard() { diff --git a/tests/other/PublicApi.Tests.cs b/tests/other/PublicApi.Tests.cs index e1fb2ef01..b79df5c38 100644 --- a/tests/other/PublicApi.Tests.cs +++ b/tests/other/PublicApi.Tests.cs @@ -17,7 +17,8 @@ internal sealed class MyEma : IResult public double? Ema { get; set; } } -internal sealed class MyCustomQuote : EquatableQuote, IQuote +internal sealed class MyCustomQuote + : EquatableQuote, IQuote { // redirect inherited base properties DateTime ISeries.TickDate => CloseDate;