The newer versions of the C# SDK don’t seem to work on real-time streaming data anymore? Older versions work fine.
Example - Older C# SDK
Alpaca.Markets 5.0.3
Alpaca.Markets.Extensions 5.0.3
My code:
quoteSubscription = alpacaDataStreamingClient.SubscribeQuote(symbol);
Thread.Sleep(5000);
quoteSubscription.Received += AlpacaStreamQuote;
From Visual Studio Immediate Window after break:
?quoteSubscription
{Alpaca.Markets.Extensions.AlpacaDataStreamingClientExtensions.DisposableAlpacaDataSubscription<Alpaca.Markets.IQuote>}
Streams: {Alpaca.Markets.AlpacaDataStreamingClient.AlpacaDataSubscription<Alpaca.Markets.IQuote, Alpaca.Markets.JsonRealTimeQuote>.<get_Streams>d__3}
Subscribed: true
Works fine.
Example - Latest C# SDK
Alpaca.Markets 5.2.16
Alpaca.Markets.Extensions 5.2.8
My code:
quoteSubscription = await alpacaDataStreamingClient.SubscribeQuoteAsync(symbol);
quoteSubscription.Received += AlpacaStreamQuote;
From Visual Studio Immediate Window after break:
?quoteSubscription
{Alpaca.Markets.Extensions.DisposableAlpacaDataSubscription<Alpaca.Markets.IQuote>}
Streams: {Alpaca.Markets.DataStreamingClientBase<Alpaca.Markets.AlpacaDataStreamingClientConfiguration>.AlpacaExplicitDataSubscription<Alpaca.Markets.IQuote, Alpaca.Markets.JsonRealTimeQuote>.<get_Streams>d__4}
Subscribed: false
Doesn’t work. Not sure if my async/awaiter code shown above is correct? The old .Subscribe non-async doesn’t exist anymore, so I can’t test it with the latest C# SDK.
Any ideas?