using System;
using DxFeed.Graal.Net.Api;
using DxFeed.Graal.Net.Events.Market;
// For token-based authorization, use the following address format:
// "demo.dxfeed.com:7300[login=entitle:token]"
using var endpoint = DXEndpoint.Create().Connect("demo.dxfeed.com:7300");
using var subscription = endpoint.GetFeed().CreateSubscription(typeof(Quote));
subscription.AddEventListener(events =>
{
foreach (var e in events)
{
Console.WriteLine(e);
}
});
subscription.AddSymbols("AAPL");
Console.ReadKey();
dxFeed Graal C/C++ API Beispiel
#include <iostream>
#include <dxfeed_graal_cpp_api/api.hpp>
int main() {
using namespace dxfcpp;
// For token-based authorization, use the following address format:
// "demo.dxfeed.com:7300[login=entitle:token]"
auto endpoint = DXEndpoint::newBuilder()
->withProperty("dxfeed.address", "demo.dxfeed.com:7300")
->build();
// Another way to connect the endpoint.
// auto endpoint = DXEndpoint::create()->connect("demo.dxfeed.com:7300");
auto subscription = endpoint->getFeed()->createSubscription(Quote::TYPE);
subscription->addEventListener([](auto&& events) {
for (auto&& e : events) {
std::cout << e << "\n";
}
});
subscription->addSymbols({"AAPL"});
std::cin.get();
}