-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
46 lines (34 loc) · 1.49 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using CryptoExchange.Net.Logging;
using Exante.Net;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
const string clientId = "";
const string applicationId = "";
const string sharedKey = "";
// Rest API
var exanteClient = new ExanteClient(clientId, applicationId, sharedKey);
// var credentials = new ExanteApiCredentials(clientId, applicationId, sharedKey);
//
// var exanteClient = new ExanteClient(credentials);
//
// var exanteClient = new ExanteClient(new ExanteClientOptions(credentials)
// {
// LogLevel = LogLevel.Debug,
// LogWriters = new List<ILogger> {new DebugLogger()},
// });
//
// var exanteDemoClient = new ExanteClient(new ExanteClientOptions(credentials, ExantePlatformType.Demo));
var exchanges = await exanteClient.GetExchangesAsync();
var symbols = await exanteClient.GetSymbolsByExchangeAsync("NASDAQ");
// Stream API
var exanteStreamClient = new ExanteStreamClient(clientId, applicationId, sharedKey);
var subscription = await exanteStreamClient.GetFeedQuoteStreamAsync(new[] {"AAPL.NASDAQ", "EUR/USD.EXANTE"}, x =>
{
Console.WriteLine($"{x.Date} " +
$"{x.SymbolId}: " +
$"{string.Join(", ", x.Bid.Select(b => b.Price))} (bid) / " +
$"{string.Join(", ", x.Ask.Select(b => b.Price))} (ask)");
});
Console.ReadKey();