Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Latest commit

 

History

History
42 lines (29 loc) · 1.1 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.1 KB

Equibles WebSockets live quotes for .Net Core

Getting Started

Checkout the Program.cs class

using System.Globalization;
using Equibles.Websockets.Client;

// Creates the websocket client
var client = new EquiblesWebSocketsClient("my_apy_key", Endpoint.Stocks, new List<string>(){"TSLA"});

// Register a callback action to be executed when a quote is received
client.OnQuote(q => {
    Console.WriteLine("Ticker: " + q.Ticker + 
                      " | Volume: " + q.Volume.ToString(CultureInfo.InvariantCulture) +  
                      " | Price: " + q.Price.ToString("C", CultureInfo.CreateSpecificCulture("en")));
});

// Connect and authenticate
await client.Connect();

// After 5 seconds I also want to listen to Apple quotes
await Task.Delay(5000);
client.AddTickers(new []{"AAPL"});

// Prevents the program from exiting
await client.Wait();

// Example output from this program:
// Ticker: AAPL | Volume: 56 | Price: $168.42
// Ticker: AAPL | Volume: 100 | Price: $168.43
// Ticker: TSLA | Volume: 33 | Price: $1,075.66

Author

Equibles
contact@equibles.com