Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Example how to connect to the realtime service using C#

Notifications You must be signed in to change notification settings

binckbank-api/client-csharp

Repository files navigation

C# client example

This is a simple example on how to connect to the Binck realtime update platform for news, quotes and order execution.

The platform is written using SignalR

After cloning or downloading this repo, make sure you add an active Bearer token in Program.cs, together with the account number:

private const string AccessToken = "YOUR-ACCESS-TOKEN";
private const string AccountNumber = "YOUR-ACCOUNT-NUMBER";

To obtain an access token to the platform please refer to the documentation here

The example will subscribe to the news feed for the country to which the account number belongs and to the last quotes for the DAX index as an example.

// Start the connection to the streamer
await hubConnection.StartAsync();

// Subscribe to the news feed
await hubConnection.InvokeAsync("SubscribeNews", 
   AccountNumber);

// Subscribe to an instrument quotes 
await hubConnection.InvokeAsync("SubscribeQuotes", 
   AccountNumber, 
   new[] { DaxIndex }, 
   "TopOfBook");

About

Example how to connect to the realtime service using C#

Topics

Resources

Stars

Watchers

Forks

Languages