From 6118858e582bfc163619b1a01b3d5e1fcc8f2393 Mon Sep 17 00:00:00 2001 From: Dave Skender <8432125+DaveSkender@users.noreply.github.com> Date: Sun, 17 Mar 2024 02:57:24 -0400 Subject: [PATCH] restore serializable attribute --- Stock.Indicators.sln | 7 ------ src/_common/Candles/Candles.Models.cs | 4 ++-- src/_common/Quotes/Quote.Models.cs | 2 ++ .../Use (quote converter)/Use.Models.cs | 1 + src/a-d/Adl/Adl.Models.cs | 1 + src/a-d/Adx/Adx.Models.cs | 1 + src/a-d/Alligator/Alligator.Models.cs | 1 + src/a-d/Alma/Alma.Models.cs | 1 + src/a-d/Aroon/Aroon.Models.cs | 1 + src/a-d/Atr/Atr.Models.cs | 1 + src/a-d/AtrStop/AtrStop.Models.cs | 1 + src/a-d/Awesome/Awesome.Models.cs | 1 + src/a-d/BasicQuote/BasicQuote.Models.cs | 1 + src/a-d/Beta/Beta.Models.cs | 1 + .../BollingerBands/BollingerBands.Models.cs | 1 + src/a-d/Bop/Bop.Models.cs | 1 + src/a-d/Cci/Cci.Models.cs | 1 + src/a-d/ChaikinOsc/ChaikinOsc.Models.cs | 1 + src/a-d/Chandelier/Chandelier.Models.cs | 1 + src/a-d/Chop/Chop.Models.cs | 1 + src/a-d/Cmf/Cmf.Models.cs | 1 + src/a-d/Cmo/Cmo.Models.cs | 1 + src/a-d/ConnorsRsi/ConnorsRsi.Models.cs | 1 + src/a-d/Correlation/Correlation.Models.cs | 1 + src/a-d/Dema/Dema.Models.cs | 1 + src/a-d/Donchian/Donchian.Models.cs | 1 + src/a-d/Dpo/Dpo.Models.cs | 1 + src/a-d/Dynamic/Dynamic.Models.cs | 1 + src/e-k/ElderRay/ElderRay.Models.cs | 1 + src/e-k/Ema/Ema.Models.cs | 1 + src/e-k/Epma/Epma.Models.cs | 1 + src/e-k/Fcb/Fcb.Models.cs | 1 + .../FisherTransform/FisherTransform.Models.cs | 1 + src/e-k/ForceIndex/ForceIndex.Models.cs | 1 + src/e-k/Fractal/Fractal.Models.cs | 1 + src/e-k/HeikinAshi/HeikinAshi.Models.cs | 1 + src/e-k/Hma/Hma.Models.cs | 1 + src/e-k/HtTrendline/HtTrendline.Models.cs | 1 + src/e-k/Hurst/Hurst.Models.cs | 1 + src/e-k/Ichimoku/Ichimoku.Models.cs | 1 + src/e-k/Kama/Kama.Models.cs | 1 + src/e-k/Keltner/Keltner.Models.cs | 1 + src/e-k/Kvo/Kvo.Models.cs | 1 + src/m-r/MaEnvelopes/MaEnvelopes.Models.cs | 1 + src/m-r/Macd/Macd.Models.cs | 1 + src/m-r/Mama/Mama.Models.cs | 1 + src/m-r/Mfi/Mfi.Models.cs | 1 + src/m-r/Obv/Obv.Models.cs | 1 + src/m-r/ParabolicSar/ParabolicSar.Models.cs | 1 + src/m-r/PivotPoints/PivotPoints.Models.cs | 1 + src/m-r/Pmo/Pmo.Models.cs | 1 + src/m-r/Prs/Prs.Models.cs | 1 + src/m-r/Pvo/Pvo.Models.cs | 1 + src/m-r/Renko/Renko.Models.cs | 1 + src/m-r/Roc/Roc.Models.cs | 1 + src/m-r/RocWb/RocWb.Models.cs | 1 + src/m-r/RollingPivots/RollingPivots.Models.cs | 1 + src/m-r/Rsi/Rsi.Models.cs | 1 + src/s-z/Slope/Slope.Models.cs | 1 + src/s-z/Sma/Sma.Models.cs | 2 ++ src/s-z/Smi/Smi.Models.cs | 1 + src/s-z/Smma/Smma.Models.cs | 1 + src/s-z/StarcBands/StarcBands.Models.cs | 1 + src/s-z/Stc/Stc.Models.cs | 1 + src/s-z/StdDev/StdDev.Models.cs | 1 + .../StdDevChannels/StdDevChannels.Models.cs | 1 + src/s-z/Stoch/Stoch.Models.cs | 1 + src/s-z/StochRsi/StochRsi.Models.cs | 1 + src/s-z/SuperTrend/SuperTrend.Models.cs | 1 + src/s-z/T3/T3.Models.cs | 1 + src/s-z/Tema/Tema.Models.cs | 1 + src/s-z/Tr/Tr.Models.cs | 1 + src/s-z/Trix/Trix.Models.cs | 1 + src/s-z/Tsi/Tsi.Models.cs | 1 + src/s-z/UlcerIndex/UlcerIndex.Models.cs | 1 + src/s-z/Ultimate/Ultimate.Models.cs | 1 + .../VolatilityStop/VolatilityStop.Models.cs | 1 + src/s-z/Vortex/Vortex.Models.cs | 1 + src/s-z/Vwap/Vwap.Models.cs | 1 + src/s-z/Vwma/Vwma.Models.cs | 1 + src/s-z/WilliamsR/WilliamsR.Models.cs | 1 + src/s-z/Wma/Wma.Models.cs | 1 + src/s-z/ZigZag/ZigZag.Models.cs | 1 + tests/observe/Program.cs | 22 +++++++++---------- 84 files changed, 96 insertions(+), 20 deletions(-) diff --git a/Stock.Indicators.sln b/Stock.Indicators.sln index 1a29b54a1..e3df0eed8 100644 --- a/Stock.Indicators.sln +++ b/Stock.Indicators.sln @@ -19,13 +19,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Other", "tests\other\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Performance", "tests\performance\Tests.Performance.csproj", "{3BD4837B-D197-41FD-A286-A3256D0770E1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{3A4158F9-4165-4823-9526-0CFAACCF1ACC}" - ProjectSection(SolutionItems) = preProject - .github\workflows\build-indicators.yml = .github\workflows\build-indicators.yml - gitversion.yml = gitversion.yml - .github\workflows\test-performance.yml = .github\workflows\test-performance.yml - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Observe.Streaming", "tests\observe\Observe.Streaming.csproj", "{14DEC3AF-9AF2-4A66-8BEE-C342C6CC4307}" ProjectSection(ProjectDependencies) = postProject {11CD6C7E-871F-4903-AEAD-58E034C6521D} = {11CD6C7E-871F-4903-AEAD-58E034C6521D} diff --git a/src/_common/Candles/Candles.Models.cs b/src/_common/Candles/Candles.Models.cs index 8342fb3cf..6ffeb3ccf 100644 --- a/src/_common/Candles/Candles.Models.cs +++ b/src/_common/Candles/Candles.Models.cs @@ -2,6 +2,7 @@ namespace Skender.Stock.Indicators; // CANDLESTICK MODELS +[Serializable] public record CandleProperties : Quote { // raw sizes @@ -20,8 +21,7 @@ public record CandleProperties : Quote public bool IsBearish => Close < Open; } - - +[Serializable] public record class CandleResult : IResult { public CandleResult(DateTime date, Match match) diff --git a/src/_common/Quotes/Quote.Models.cs b/src/_common/Quotes/Quote.Models.cs index 504183e10..17b1ec02a 100644 --- a/src/_common/Quotes/Quote.Models.cs +++ b/src/_common/Quotes/Quote.Models.cs @@ -18,6 +18,7 @@ public interface IQuote : ISeries, IEquatable /// /// Built-in Quote type. /// +[Serializable] public record class Quote : IQuote { public DateTime Timestamp { get; set; } @@ -103,6 +104,7 @@ public override int GetHashCode() Timestamp, Open, High, Low, Close, Volume); } +[Serializable] internal class QuoteD { internal DateTime Timestamp { get; set; } diff --git a/src/_common/Use (quote converter)/Use.Models.cs b/src/_common/Use (quote converter)/Use.Models.cs index c8aae46a3..ae14e88b4 100644 --- a/src/_common/Use (quote converter)/Use.Models.cs +++ b/src/_common/Use (quote converter)/Use.Models.cs @@ -1,6 +1,7 @@ namespace Skender.Stock.Indicators; // TODO: this is redundant to "BasicResult", but it has a funny name +[Serializable] public sealed record class UseResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Adl/Adl.Models.cs b/src/a-d/Adl/Adl.Models.cs index f68cfb02e..5369f5f9e 100644 --- a/src/a-d/Adl/Adl.Models.cs +++ b/src/a-d/Adl/Adl.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AdlResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Adx/Adx.Models.cs b/src/a-d/Adx/Adx.Models.cs index 34dd43532..949a96516 100644 --- a/src/a-d/Adx/Adx.Models.cs +++ b/src/a-d/Adx/Adx.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AdxResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Alligator/Alligator.Models.cs b/src/a-d/Alligator/Alligator.Models.cs index c06f5b8d1..703148933 100644 --- a/src/a-d/Alligator/Alligator.Models.cs +++ b/src/a-d/Alligator/Alligator.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AlligatorResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Alma/Alma.Models.cs b/src/a-d/Alma/Alma.Models.cs index d6fd955df..dd134cd2d 100644 --- a/src/a-d/Alma/Alma.Models.cs +++ b/src/a-d/Alma/Alma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AlmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Aroon/Aroon.Models.cs b/src/a-d/Aroon/Aroon.Models.cs index 3c97f5d8f..67de41e02 100644 --- a/src/a-d/Aroon/Aroon.Models.cs +++ b/src/a-d/Aroon/Aroon.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AroonResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Atr/Atr.Models.cs b/src/a-d/Atr/Atr.Models.cs index 111d2b4c4..42a5a43d5 100644 --- a/src/a-d/Atr/Atr.Models.cs +++ b/src/a-d/Atr/Atr.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AtrResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/AtrStop/AtrStop.Models.cs b/src/a-d/AtrStop/AtrStop.Models.cs index 04552c5f5..6dc883b8a 100644 --- a/src/a-d/AtrStop/AtrStop.Models.cs +++ b/src/a-d/AtrStop/AtrStop.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AtrStopResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Awesome/Awesome.Models.cs b/src/a-d/Awesome/Awesome.Models.cs index 344ea39e4..1f4738148 100644 --- a/src/a-d/Awesome/Awesome.Models.cs +++ b/src/a-d/Awesome/Awesome.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class AwesomeResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/BasicQuote/BasicQuote.Models.cs b/src/a-d/BasicQuote/BasicQuote.Models.cs index a64d4b546..a1404d15a 100644 --- a/src/a-d/BasicQuote/BasicQuote.Models.cs +++ b/src/a-d/BasicQuote/BasicQuote.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class BasicResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Beta/Beta.Models.cs b/src/a-d/Beta/Beta.Models.cs index 091f2e050..74e34ecd7 100644 --- a/src/a-d/Beta/Beta.Models.cs +++ b/src/a-d/Beta/Beta.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class BetaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/BollingerBands/BollingerBands.Models.cs b/src/a-d/BollingerBands/BollingerBands.Models.cs index 85e5f31aa..0866ae351 100644 --- a/src/a-d/BollingerBands/BollingerBands.Models.cs +++ b/src/a-d/BollingerBands/BollingerBands.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class BollingerBandsResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Bop/Bop.Models.cs b/src/a-d/Bop/Bop.Models.cs index fa0669e78..b36f0c5d9 100644 --- a/src/a-d/Bop/Bop.Models.cs +++ b/src/a-d/Bop/Bop.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class BopResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Cci/Cci.Models.cs b/src/a-d/Cci/Cci.Models.cs index cc0266c8f..9821737b8 100644 --- a/src/a-d/Cci/Cci.Models.cs +++ b/src/a-d/Cci/Cci.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class CciResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/ChaikinOsc/ChaikinOsc.Models.cs b/src/a-d/ChaikinOsc/ChaikinOsc.Models.cs index f16d2d522..538732a4d 100644 --- a/src/a-d/ChaikinOsc/ChaikinOsc.Models.cs +++ b/src/a-d/ChaikinOsc/ChaikinOsc.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ChaikinOscResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Chandelier/Chandelier.Models.cs b/src/a-d/Chandelier/Chandelier.Models.cs index 5a15a412c..c0e6af9e3 100644 --- a/src/a-d/Chandelier/Chandelier.Models.cs +++ b/src/a-d/Chandelier/Chandelier.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ChandelierResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Chop/Chop.Models.cs b/src/a-d/Chop/Chop.Models.cs index c63db3abd..94de65f27 100644 --- a/src/a-d/Chop/Chop.Models.cs +++ b/src/a-d/Chop/Chop.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ChopResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Cmf/Cmf.Models.cs b/src/a-d/Cmf/Cmf.Models.cs index 6e239ccd4..6cc046bb5 100644 --- a/src/a-d/Cmf/Cmf.Models.cs +++ b/src/a-d/Cmf/Cmf.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class CmfResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Cmo/Cmo.Models.cs b/src/a-d/Cmo/Cmo.Models.cs index 4785e5b76..f37b83333 100644 --- a/src/a-d/Cmo/Cmo.Models.cs +++ b/src/a-d/Cmo/Cmo.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class CmoResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/ConnorsRsi/ConnorsRsi.Models.cs b/src/a-d/ConnorsRsi/ConnorsRsi.Models.cs index e80fe3348..e177af75c 100644 --- a/src/a-d/ConnorsRsi/ConnorsRsi.Models.cs +++ b/src/a-d/ConnorsRsi/ConnorsRsi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ConnorsRsiResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Correlation/Correlation.Models.cs b/src/a-d/Correlation/Correlation.Models.cs index ccf28f3f4..0d2f0af49 100644 --- a/src/a-d/Correlation/Correlation.Models.cs +++ b/src/a-d/Correlation/Correlation.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class CorrResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Dema/Dema.Models.cs b/src/a-d/Dema/Dema.Models.cs index 5dc3d8ed9..053bf7097 100644 --- a/src/a-d/Dema/Dema.Models.cs +++ b/src/a-d/Dema/Dema.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class DemaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Donchian/Donchian.Models.cs b/src/a-d/Donchian/Donchian.Models.cs index d7ec449f1..ab13254b4 100644 --- a/src/a-d/Donchian/Donchian.Models.cs +++ b/src/a-d/Donchian/Donchian.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class DonchianResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Dpo/Dpo.Models.cs b/src/a-d/Dpo/Dpo.Models.cs index 78d0cc063..45d37a144 100644 --- a/src/a-d/Dpo/Dpo.Models.cs +++ b/src/a-d/Dpo/Dpo.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class DpoResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/a-d/Dynamic/Dynamic.Models.cs b/src/a-d/Dynamic/Dynamic.Models.cs index 2f5b480de..6683660eb 100644 --- a/src/a-d/Dynamic/Dynamic.Models.cs +++ b/src/a-d/Dynamic/Dynamic.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class DynamicResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/ElderRay/ElderRay.Models.cs b/src/e-k/ElderRay/ElderRay.Models.cs index 67f5fc53b..87894dc7d 100644 --- a/src/e-k/ElderRay/ElderRay.Models.cs +++ b/src/e-k/ElderRay/ElderRay.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ElderRayResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Ema/Ema.Models.cs b/src/e-k/Ema/Ema.Models.cs index 5b4c0d3f5..13bd52690 100644 --- a/src/e-k/Ema/Ema.Models.cs +++ b/src/e-k/Ema/Ema.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class EmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Epma/Epma.Models.cs b/src/e-k/Epma/Epma.Models.cs index 8357be0cf..f99c5d47d 100644 --- a/src/e-k/Epma/Epma.Models.cs +++ b/src/e-k/Epma/Epma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class EpmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Fcb/Fcb.Models.cs b/src/e-k/Fcb/Fcb.Models.cs index c62dfcace..1d20511f0 100644 --- a/src/e-k/Fcb/Fcb.Models.cs +++ b/src/e-k/Fcb/Fcb.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class FcbResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/FisherTransform/FisherTransform.Models.cs b/src/e-k/FisherTransform/FisherTransform.Models.cs index f139511ee..9dd113662 100644 --- a/src/e-k/FisherTransform/FisherTransform.Models.cs +++ b/src/e-k/FisherTransform/FisherTransform.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class FisherTransformResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/ForceIndex/ForceIndex.Models.cs b/src/e-k/ForceIndex/ForceIndex.Models.cs index b5c0b53bb..be6e69dc9 100644 --- a/src/e-k/ForceIndex/ForceIndex.Models.cs +++ b/src/e-k/ForceIndex/ForceIndex.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ForceIndexResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Fractal/Fractal.Models.cs b/src/e-k/Fractal/Fractal.Models.cs index ce2c0bc9e..9cb60b37f 100644 --- a/src/e-k/Fractal/Fractal.Models.cs +++ b/src/e-k/Fractal/Fractal.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class FractalResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/HeikinAshi/HeikinAshi.Models.cs b/src/e-k/HeikinAshi/HeikinAshi.Models.cs index d15553272..f55edd0b9 100644 --- a/src/e-k/HeikinAshi/HeikinAshi.Models.cs +++ b/src/e-k/HeikinAshi/HeikinAshi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class HeikinAshiResult : IResult, IQuote { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Hma/Hma.Models.cs b/src/e-k/Hma/Hma.Models.cs index b2240b6d3..f95c3faf7 100644 --- a/src/e-k/Hma/Hma.Models.cs +++ b/src/e-k/Hma/Hma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class HmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/HtTrendline/HtTrendline.Models.cs b/src/e-k/HtTrendline/HtTrendline.Models.cs index cc0167828..f981e3d8d 100644 --- a/src/e-k/HtTrendline/HtTrendline.Models.cs +++ b/src/e-k/HtTrendline/HtTrendline.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class HtlResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Hurst/Hurst.Models.cs b/src/e-k/Hurst/Hurst.Models.cs index f6b442e28..9100e102e 100644 --- a/src/e-k/Hurst/Hurst.Models.cs +++ b/src/e-k/Hurst/Hurst.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class HurstResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Ichimoku/Ichimoku.Models.cs b/src/e-k/Ichimoku/Ichimoku.Models.cs index 207c74d95..ee03e557f 100644 --- a/src/e-k/Ichimoku/Ichimoku.Models.cs +++ b/src/e-k/Ichimoku/Ichimoku.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class IchimokuResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Kama/Kama.Models.cs b/src/e-k/Kama/Kama.Models.cs index 3c11b08ff..34e9c42ca 100644 --- a/src/e-k/Kama/Kama.Models.cs +++ b/src/e-k/Kama/Kama.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class KamaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Keltner/Keltner.Models.cs b/src/e-k/Keltner/Keltner.Models.cs index af84e7b6a..18618feb0 100644 --- a/src/e-k/Keltner/Keltner.Models.cs +++ b/src/e-k/Keltner/Keltner.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class KeltnerResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/e-k/Kvo/Kvo.Models.cs b/src/e-k/Kvo/Kvo.Models.cs index b7e9462bb..a1384191c 100644 --- a/src/e-k/Kvo/Kvo.Models.cs +++ b/src/e-k/Kvo/Kvo.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class KvoResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/MaEnvelopes/MaEnvelopes.Models.cs b/src/m-r/MaEnvelopes/MaEnvelopes.Models.cs index 2fb690084..74250c13b 100644 --- a/src/m-r/MaEnvelopes/MaEnvelopes.Models.cs +++ b/src/m-r/MaEnvelopes/MaEnvelopes.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class MaEnvelopeResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Macd/Macd.Models.cs b/src/m-r/Macd/Macd.Models.cs index f92e32365..1f966aa62 100644 --- a/src/m-r/Macd/Macd.Models.cs +++ b/src/m-r/Macd/Macd.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class MacdResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Mama/Mama.Models.cs b/src/m-r/Mama/Mama.Models.cs index 6a853cd48..c89cfc7d2 100644 --- a/src/m-r/Mama/Mama.Models.cs +++ b/src/m-r/Mama/Mama.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class MamaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Mfi/Mfi.Models.cs b/src/m-r/Mfi/Mfi.Models.cs index 6197e9a55..7a14bea17 100644 --- a/src/m-r/Mfi/Mfi.Models.cs +++ b/src/m-r/Mfi/Mfi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class MfiResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Obv/Obv.Models.cs b/src/m-r/Obv/Obv.Models.cs index 92d8219bd..aa2976fcf 100644 --- a/src/m-r/Obv/Obv.Models.cs +++ b/src/m-r/Obv/Obv.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ObvResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/ParabolicSar/ParabolicSar.Models.cs b/src/m-r/ParabolicSar/ParabolicSar.Models.cs index 78dd2f1c1..c78aedf15 100644 --- a/src/m-r/ParabolicSar/ParabolicSar.Models.cs +++ b/src/m-r/ParabolicSar/ParabolicSar.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ParabolicSarResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/PivotPoints/PivotPoints.Models.cs b/src/m-r/PivotPoints/PivotPoints.Models.cs index be5ce7c37..d3c1f6c34 100644 --- a/src/m-r/PivotPoints/PivotPoints.Models.cs +++ b/src/m-r/PivotPoints/PivotPoints.Models.cs @@ -13,6 +13,7 @@ internal interface IPivotPoint public decimal? S4 { get; set; } } +[Serializable] public sealed record class PivotPointsResult : IResult, IPivotPoint { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Pmo/Pmo.Models.cs b/src/m-r/Pmo/Pmo.Models.cs index 538542838..f5dd9b5ef 100644 --- a/src/m-r/Pmo/Pmo.Models.cs +++ b/src/m-r/Pmo/Pmo.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class PmoResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Prs/Prs.Models.cs b/src/m-r/Prs/Prs.Models.cs index a56cff843..71ce3720c 100644 --- a/src/m-r/Prs/Prs.Models.cs +++ b/src/m-r/Prs/Prs.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class PrsResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Pvo/Pvo.Models.cs b/src/m-r/Pvo/Pvo.Models.cs index 4fe54754f..7f1b1ff45 100644 --- a/src/m-r/Pvo/Pvo.Models.cs +++ b/src/m-r/Pvo/Pvo.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class PvoResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Renko/Renko.Models.cs b/src/m-r/Renko/Renko.Models.cs index 51c7fb1c9..ee377f22f 100644 --- a/src/m-r/Renko/Renko.Models.cs +++ b/src/m-r/Renko/Renko.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class RenkoResult : IResult, IQuote { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Roc/Roc.Models.cs b/src/m-r/Roc/Roc.Models.cs index 241d2d3f1..4fb15fe7d 100644 --- a/src/m-r/Roc/Roc.Models.cs +++ b/src/m-r/Roc/Roc.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class RocResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/RocWb/RocWb.Models.cs b/src/m-r/RocWb/RocWb.Models.cs index 153335050..8a87e4a06 100644 --- a/src/m-r/RocWb/RocWb.Models.cs +++ b/src/m-r/RocWb/RocWb.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class RocWbResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/m-r/RollingPivots/RollingPivots.Models.cs b/src/m-r/RollingPivots/RollingPivots.Models.cs index 44a472e6c..ed24c8d8d 100644 --- a/src/m-r/RollingPivots/RollingPivots.Models.cs +++ b/src/m-r/RollingPivots/RollingPivots.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class RollingPivotsResult : IResult, IPivotPoint { public DateTime Timestamp { get; set; } diff --git a/src/m-r/Rsi/Rsi.Models.cs b/src/m-r/Rsi/Rsi.Models.cs index e8f50f4fd..eb3c0ec56 100644 --- a/src/m-r/Rsi/Rsi.Models.cs +++ b/src/m-r/Rsi/Rsi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class RsiResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Slope/Slope.Models.cs b/src/s-z/Slope/Slope.Models.cs index 265c31bf3..06d8704e9 100644 --- a/src/s-z/Slope/Slope.Models.cs +++ b/src/s-z/Slope/Slope.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class SlopeResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Sma/Sma.Models.cs b/src/s-z/Sma/Sma.Models.cs index 6db6208f6..8b60ffd58 100644 --- a/src/s-z/Sma/Sma.Models.cs +++ b/src/s-z/Sma/Sma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class SmaResult : IReusableResult { public DateTime Timestamp { get; set; } @@ -8,6 +9,7 @@ public sealed record class SmaResult : IReusableResult double IReusableResult.Value => Sma.Null2NaN(); } +[Serializable] public sealed record class SmaAnalysis : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Smi/Smi.Models.cs b/src/s-z/Smi/Smi.Models.cs index 668abee06..d1d7783d8 100644 --- a/src/s-z/Smi/Smi.Models.cs +++ b/src/s-z/Smi/Smi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class SmiResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Smma/Smma.Models.cs b/src/s-z/Smma/Smma.Models.cs index c70601329..bb8946b44 100644 --- a/src/s-z/Smma/Smma.Models.cs +++ b/src/s-z/Smma/Smma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class SmmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/StarcBands/StarcBands.Models.cs b/src/s-z/StarcBands/StarcBands.Models.cs index 515eb211a..1d07d30df 100644 --- a/src/s-z/StarcBands/StarcBands.Models.cs +++ b/src/s-z/StarcBands/StarcBands.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class StarcBandsResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Stc/Stc.Models.cs b/src/s-z/Stc/Stc.Models.cs index fea317b5c..acb42ddd3 100644 --- a/src/s-z/Stc/Stc.Models.cs +++ b/src/s-z/Stc/Stc.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class StcResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/StdDev/StdDev.Models.cs b/src/s-z/StdDev/StdDev.Models.cs index a38d03687..990b24c78 100644 --- a/src/s-z/StdDev/StdDev.Models.cs +++ b/src/s-z/StdDev/StdDev.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class StdDevResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/StdDevChannels/StdDevChannels.Models.cs b/src/s-z/StdDevChannels/StdDevChannels.Models.cs index 5acf3bb5b..29d51bc15 100644 --- a/src/s-z/StdDevChannels/StdDevChannels.Models.cs +++ b/src/s-z/StdDevChannels/StdDevChannels.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class StdDevChannelsResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Stoch/Stoch.Models.cs b/src/s-z/Stoch/Stoch.Models.cs index 9590b3f0a..5425728ab 100644 --- a/src/s-z/Stoch/Stoch.Models.cs +++ b/src/s-z/Stoch/Stoch.Models.cs @@ -2,6 +2,7 @@ namespace Skender.Stock.Indicators; /// /// +[Serializable] public sealed record class StochResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/StochRsi/StochRsi.Models.cs b/src/s-z/StochRsi/StochRsi.Models.cs index cb45145fd..ee27320f8 100644 --- a/src/s-z/StochRsi/StochRsi.Models.cs +++ b/src/s-z/StochRsi/StochRsi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class StochRsiResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/SuperTrend/SuperTrend.Models.cs b/src/s-z/SuperTrend/SuperTrend.Models.cs index df95ad323..4715daeb2 100644 --- a/src/s-z/SuperTrend/SuperTrend.Models.cs +++ b/src/s-z/SuperTrend/SuperTrend.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class SuperTrendResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/T3/T3.Models.cs b/src/s-z/T3/T3.Models.cs index dfc2e9d1f..0e50c7334 100644 --- a/src/s-z/T3/T3.Models.cs +++ b/src/s-z/T3/T3.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class T3Result : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Tema/Tema.Models.cs b/src/s-z/Tema/Tema.Models.cs index a27355877..a57a1a447 100644 --- a/src/s-z/Tema/Tema.Models.cs +++ b/src/s-z/Tema/Tema.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class TemaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Tr/Tr.Models.cs b/src/s-z/Tr/Tr.Models.cs index 6ba75f67e..f03a616ca 100644 --- a/src/s-z/Tr/Tr.Models.cs +++ b/src/s-z/Tr/Tr.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class TrResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Trix/Trix.Models.cs b/src/s-z/Trix/Trix.Models.cs index 662301d4e..2985c4ec9 100644 --- a/src/s-z/Trix/Trix.Models.cs +++ b/src/s-z/Trix/Trix.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class TrixResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Tsi/Tsi.Models.cs b/src/s-z/Tsi/Tsi.Models.cs index 0d02cc4b9..1955b49b7 100644 --- a/src/s-z/Tsi/Tsi.Models.cs +++ b/src/s-z/Tsi/Tsi.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class TsiResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/UlcerIndex/UlcerIndex.Models.cs b/src/s-z/UlcerIndex/UlcerIndex.Models.cs index 27a04997a..30602a71a 100644 --- a/src/s-z/UlcerIndex/UlcerIndex.Models.cs +++ b/src/s-z/UlcerIndex/UlcerIndex.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class UlcerIndexResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Ultimate/Ultimate.Models.cs b/src/s-z/Ultimate/Ultimate.Models.cs index cee70c029..4089b56ce 100644 --- a/src/s-z/Ultimate/Ultimate.Models.cs +++ b/src/s-z/Ultimate/Ultimate.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class UltimateResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/VolatilityStop/VolatilityStop.Models.cs b/src/s-z/VolatilityStop/VolatilityStop.Models.cs index aa7001cf7..e6b9f2270 100644 --- a/src/s-z/VolatilityStop/VolatilityStop.Models.cs +++ b/src/s-z/VolatilityStop/VolatilityStop.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class VolatilityStopResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Vortex/Vortex.Models.cs b/src/s-z/Vortex/Vortex.Models.cs index 0375f34b4..8310e1ea2 100644 --- a/src/s-z/Vortex/Vortex.Models.cs +++ b/src/s-z/Vortex/Vortex.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class VortexResult : IResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Vwap/Vwap.Models.cs b/src/s-z/Vwap/Vwap.Models.cs index 0e960248f..462b28a39 100644 --- a/src/s-z/Vwap/Vwap.Models.cs +++ b/src/s-z/Vwap/Vwap.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class VwapResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Vwma/Vwma.Models.cs b/src/s-z/Vwma/Vwma.Models.cs index 7070c2aa5..af0026671 100644 --- a/src/s-z/Vwma/Vwma.Models.cs +++ b/src/s-z/Vwma/Vwma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class VwmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/WilliamsR/WilliamsR.Models.cs b/src/s-z/WilliamsR/WilliamsR.Models.cs index 5fd3b3698..9c1f9e7ad 100644 --- a/src/s-z/WilliamsR/WilliamsR.Models.cs +++ b/src/s-z/WilliamsR/WilliamsR.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class WilliamsResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/Wma/Wma.Models.cs b/src/s-z/Wma/Wma.Models.cs index 99485500a..728adfd92 100644 --- a/src/s-z/Wma/Wma.Models.cs +++ b/src/s-z/Wma/Wma.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class WmaResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/src/s-z/ZigZag/ZigZag.Models.cs b/src/s-z/ZigZag/ZigZag.Models.cs index aac094d99..d438a8635 100644 --- a/src/s-z/ZigZag/ZigZag.Models.cs +++ b/src/s-z/ZigZag/ZigZag.Models.cs @@ -1,5 +1,6 @@ namespace Skender.Stock.Indicators; +[Serializable] public sealed record class ZigZagResult : IReusableResult { public DateTime Timestamp { get; set; } diff --git a/tests/observe/Program.cs b/tests/observe/Program.cs index f89bbd931..adf3675ad 100644 --- a/tests/observe/Program.cs +++ b/tests/observe/Program.cs @@ -19,22 +19,22 @@ private static async Task Main(string[] args) public class QuoteStream { - private readonly string alpacaApiKey = Environment.GetEnvironmentVariable("ALPACA_KEY"); - private readonly string alpacaSecret = Environment.GetEnvironmentVariable("ALPACA_SECRET"); + private readonly string ALPACA_KEY = Environment.GetEnvironmentVariable("ALPACA_KEY"); + private readonly string ALPACA_SECRET = Environment.GetEnvironmentVariable("ALPACA_SECRET"); internal QuoteStream() { - if (string.IsNullOrEmpty(alpacaApiKey)) + if (string.IsNullOrEmpty(ALPACA_KEY)) { throw new ArgumentNullException( - alpacaApiKey, + ALPACA_KEY, $"API KEY missing, use `setx ALPACA_KEY \"MY_ALPACA_KEY\"` to set."); } - if (string.IsNullOrEmpty(alpacaSecret)) + if (string.IsNullOrEmpty(ALPACA_SECRET)) { throw new ArgumentNullException( - alpacaSecret, + ALPACA_SECRET, $"API SECRET missing, use `setx ALPACA_SECRET \"MY_ALPACA_SECRET\"` to set."); } } @@ -44,14 +44,14 @@ public async Task SubscribeToQuotes(string symbol) Console.WriteLine("Press any key to exit the process..."); Console.WriteLine("PLEASE WAIT. QUOTES ARRIVE EVERY MINUTE."); - if (string.IsNullOrEmpty(alpacaApiKey)) + if (string.IsNullOrEmpty(ALPACA_KEY)) { - throw new ArgumentNullException(alpacaApiKey); + throw new ArgumentNullException(ALPACA_KEY); } - if (string.IsNullOrEmpty(alpacaSecret)) + if (string.IsNullOrEmpty(ALPACA_SECRET)) { - throw new ArgumentNullException(alpacaSecret); + throw new ArgumentNullException(ALPACA_SECRET); } // initialize our quote provider and a few subscribers @@ -67,7 +67,7 @@ public async Task SubscribeToQuotes(string symbol) .AttachEma(4); // connect to Alpaca websocket - SecretKey secretKey = new(alpacaApiKey, alpacaSecret); + SecretKey secretKey = new(ALPACA_KEY, ALPACA_SECRET); IAlpacaCryptoStreamingClient client = Environments