IntrinioRealTimeClient 4.1.1
See the version list below for details.
dotnet add package IntrinioRealTimeClient --version 4.1.1
NuGet\Install-Package IntrinioRealTimeClient -Version 4.1.1
<PackageReference Include="IntrinioRealTimeClient" Version="4.1.1" />
paket add IntrinioRealTimeClient --version 4.1.1
#r "nuget: IntrinioRealTimeClient, 4.1.1"
// Install IntrinioRealTimeClient as a Cake Addin #addin nuget:?package=IntrinioRealTimeClient&version=4.1.1 // Install IntrinioRealTimeClient as a Cake Tool #tool nuget:?package=IntrinioRealTimeClient&version=4.1.1
intrinio-realtime-dotnet-sdk
SDK for working with Intrinio's realtime Multi-Exchange or delayed SIP prices feed. Intrinio’s Multi-Exchange feed bridges the gap by merging real-time equity pricing from the IEX and MEMX exchanges. Get a comprehensive view with increased market volume and enjoy no exchange fees, no per-user requirements, no permissions or authorizations, and little to no paperwork.
Intrinio provides real-time stock prices via a two-way WebSocket connection. To get started, subscribe to a real-time data feed and follow the instructions below.
Documentation for our legacy realtime client
Requirements
- .NET 5+
Installation
Go to Release, download the DLLs, reference it in your project. The DLLs contains dependencies necessary to the SDK.
Sample Project
For a sample .NET project see: intrinio-realtime-options-dotnet-sdk
Features
- Receive streaming, real-time price quotes (last trade, bid, ask)
- Subscribe to updates from individual securities
- Subscribe to updates for all securities
Example Usage
static void Main(string[] _)
{
Client.Log("Starting sample app");
client = new Client(OnTrade, OnQuote);
timer = new Timer(TimerCallback, client, 10000, 10000);
client.Join(); //Load symbols from config.json
//client.Join(new string[] { "AAPL", "GOOG", "MSFT" }, false); //Specify symbols at runtime
Console.CancelKeyPress += new ConsoleCancelEventHandler(Cancel);
}
Handling Quotes
There are thousands of securities, each with their own feed of activity. We highly encourage you to make your trade and quote handlers has short as possible and follow a queue pattern so your app can handle the volume of activity.
Data Format
Trade Message
type [<Struct>] Trade =
{
Symbol : string
Price : float
Size : uint32
TotalVolume : uint64
Timestamp : DateTime
}
- Symbol - Ticker symbol.
- Price - the price in USD
- Size - the size of the last trade.
- TotalVolume - The number of stocks traded so far today for this symbol.
- Timestamp - a Unix timestamp
Quote Message
type [<Struct>] Quote =
{
Type : QuoteType
Symbol : string
Price : float
Size : uint32
Timestamp : DateTime
}
- Type - the quote type
Ask
- represents an ask typeBid
- represents a bid type
- Symbol - Ticker symbol.
- Price - the price in USD
- Size - the size of the last ask or bid.
- Timestamp - a Unix timestamp
API Keys
You will receive your Intrinio API Key after creating an account. You will need a subscription to a realtime data feed as well.
Methods
Client client = new Client(OnTrade, OnQuote);
- Creates a new instance of the Intrinio Real-Time client. The provided actions implement OnTrade and OnQuote, which handle what happens when the associated event happens.
- Parameter
onTrade
: The Action accepting trades. This function will be invoked when a 'trade' has been received. The trade will be passed as an argument to the callback. - Parameter
onQuote
: Optional. The Action accepting quotes. This function will be invoked when a 'quote' has been received. The quote will be passed as an argument to the callback. If 'onQuote' is not provided, the client will NOT request to receive quote updates from the server.
client.Join(symbols, tradesOnly);
- Joins the given channels. This can be called at any time. The client will automatically register joined channels and establish the proper subscriptions with the WebSocket connection. If no arguments are provided, this function joins channel(s) configured in config.json.
- Parameter
symbols
- Optional. A string representing a single ticker symbol (e.g. "AAPL") or an array of ticker symbols (e.g. ["AAPL", "MSFT", "GOOG"]) to join. You can also use the special symbol, "lobby" to join the firehose channel and recieved updates for all ticker symbols. You must have a valid "firehose" subscription. - Parameter
tradesOnly
- Optional (default: false). A boolean value indicating whether the server should return trade data only (as opposed to trade and quote data).
client.Join(["AAPL", "MSFT", "GOOG"])
client.Join("GE", true)
client.Join("lobby") //must have a valid 'firehose' subscription
client.Leave(symbols)
- Leaves the given channels.
- Parameter
symbols
- Optional (default = all channels). A string representing a single ticker symbol (e.g. "AAPL") or an array of ticker symbols (e.g. ["AAPL", "MSFT", "GOOG"]) to leave. If not provided, all subscribed channels will be unsubscribed.
client.Leave(["AAPL", "MSFT", "GOOG"])
client.Leave("GE")
client.Leave("lobby")
client.Leave()
client.Stop()
- Closes the WebSocket, stops the self-healing and heartbeat intervals. Call this to properly dispose of the client.
Configuration
config.json
{
"Config": {
"ApiKey": "", //Your Intrinio API key.
"NumThreads": 2, //The number of threads to use for processing events.
"Provider": "REALTIME", //or DELAYED_SIP or MANUAL
"Symbols": [ "AAPL", "MSFT", "GOOG" ], //This is a list of individual tickers to subscribe to, or "lobby" to subscribe to all at once (firehose).
"TradesOnly": true //This indicates whether you only want trade events (true) or you want trade, ask, and bid events (false).
},
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{ "Name": "Console" }
]
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- FSharp.Core (>= 6.0.3)
- Microsoft.Extensions.Configuration (>= 6.0.1)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- Serilog (>= 2.10.0)
- Serilog.Settings.Configuration (>= 3.3.0)
- Serilog.Sinks.Console (>= 4.0.1)
- Serilog.Sinks.File (>= 5.0.0)
- System.Text.Json (>= 6.0.3)
- WebSocket4Net (>= 0.15.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
12.1.2 | 53 | 10/28/2024 |
12.1.1 | 46 | 10/28/2024 |
12.0.4 | 54 | 10/24/2024 |
11.0.4 | 55 | 10/14/2024 |
11.0.3 | 44 | 10/7/2024 |
11.0.2 | 49 | 10/7/2024 |
11.0.1 | 53 | 10/3/2024 |
11.0.0 | 54 | 10/3/2024 |
10.0.0 | 106 | 7/11/2024 |
9.2.0 | 130 | 3/14/2024 |
9.1.1 | 188 | 3/9/2024 |
9.1.0 | 119 | 3/9/2024 |
9.0.0 | 135 | 2/20/2024 |
8.3.2 | 238 | 10/30/2023 |
8.3.1 | 146 | 10/30/2023 |
8.3.0 | 144 | 10/30/2023 |
8.2.0 | 117 | 10/27/2023 |
8.1.2 | 127 | 10/16/2023 |
8.1.1 | 205 | 8/16/2023 |
8.0.1 | 173 | 7/23/2023 |
8.0.0 | 177 | 7/14/2023 |
7.0.0 | 152 | 5/25/2023 |
7.0.0-beta | 197 | 5/9/2023 |
7.0.0-alpha | 120 | 5/9/2023 |
6.2.1 | 181 | 4/20/2023 |
6.1.1 | 219 | 4/17/2023 |
6.0.1 | 239 | 3/10/2023 |
5.0.0 | 228 | 3/5/2023 |
4.3.1 | 258 | 3/4/2023 |
4.2.0 | 243 | 3/2/2023 |
4.1.1 | 294 | 1/25/2023 |
4.1.0 | 288 | 1/24/2023 |
4.0.0 | 460 | 4/25/2022 |
3.0.0 | 488 | 10/22/2021 |
2.2.0-rc | 709 | 2/13/2019 |
2.1.0-rc | 653 | 11/30/2018 |
2.0.0-rc | 864 | 10/18/2017 |
1.0.0-rc | 897 | 9/21/2017 |
Version 4.1.1 release.