FFT.Oanda
FFT.Oanda
is a .Net client for the Oanda
api
Use the latest version 2.x.x package to connect to the Oanda V2 api. When Oanda releases new api versions, this package will adjust new major versions to match the Oanda api version. For example, when Oanda releases their V3 version, you can use the latest 3.x.x package to connect to it.
Usage
The basic idea is to create a long-lived singleton instance of the api client which you reuse throughout your application. It is threadsafe.
using System;
using FFT.Oanda;
using FFT.Oanda.Accounts;
using var client = new OandaApiClient(AccountType.Real, "your_api_key");
// Get the id of the first account
var myAccounts = await client.GetAccounts();
var primaryAccountId = myAccounts[0].Id;
// Subscribe to that account's transaction stream
await foreach(var transaction in client.GetTransactionsStream(primaryAccountId))
{
}
See complete documentation including the list of OandaApiClient
methods here.