FinClient 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FinClient --version 0.1.0
                    
NuGet\Install-Package FinClient -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FinClient" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FinClient" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FinClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FinClient --version 0.1.0
                    
#r "nuget: FinClient, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FinClient@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FinClient&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FinClient&version=0.1.0
                    
Install as a Cake Tool

FinClient for .NET

The official .NET client for the FinCopy public API: hosted MetaTrader accounts, their settings, trading, the change feed and webhooks. Runs on .NET 8 or later and on .NET Standard 2.0 (including .NET Framework 4.6.2+).

dotnet add package FinClient

Quick start

using Fin;
using Fin.Copy;

using var fin = new FinClient(new FinClientOptions { ApiKey = Environment.GetEnvironmentVariable("FINCOPY_API_KEY")! });

var accounts = await fin.Copy.Accounts.ListAsync();

Create one FinClient per API key and reuse it; it is safe to share between threads. With dependency injection, register it once:

services.AddFinClient(options => options.ApiKey = configuration["FinCopy:ApiKey"]!);

Trades complete asynchronously

fin.Copy.Orders.MakeAsync(...) returns once the order is queued for your MetaTrader terminal, not when it is filled. The terminal picks it up on its next sync (seconds). Follow the change feed, or set a webhook, to see each order filled (with its ticket) or refused (with the reason).

The change feed

Read it a page at a time and save the cursor after handling each page, so a restart carries on where it stopped:

string? cursor = LoadSavedCursor();   // null the first time: the feed starts at "now"
await foreach (var page in fin.Copy.Changes.ReadPagesAsync(cursor))
{
    foreach (var change in page.Changes ?? []) Handle(change);
    SaveCursor(page.Cursor);
}

ReadAllAsync streams the rows without the cursor, for when you do not need to resume.

Webhooks

FinCopy signs every webhook POST. Check it before trusting the body:

var valid = FinWebhook.Verify(secret, request.Headers["X-FinCopy-Timestamp"], rawBody, request.Headers["X-FinCopy-Signature"]);

Pass the raw request body, exactly as received. Signatures older than five minutes are refused.

Errors, retries and idempotency

  • A failed call throws FinApiException with the HTTP StatusCode, FinCopy's Code, Message and Errors. ErrorCode is timeout, network, rate_limited, invalid_response or empty_response when the SDK can say why; RetryAfter is how long the API asked you to wait.
  • Rate limits (429) and gateway errors (502, 503, 504) are retried with back-off, honouring Retry-After up to 60 seconds, MaxRetries times (3 by default).
  • Every write carries an Idempotency-Key, generated for you or passed as idempotencyKey, and a retry reuses it, so the API applies the write once.
  • FinClientOptions.Timeout (30 seconds) limits each attempt. When you pass your own HttpClient, its Timeout applies too.

Notes

  • Server-side only. An API key reaches real trading accounts: never put it in a browser, a mobile app, source control or logs.
  • Data types keep FinCopy's field names exactly (ACNO, SYM, LOT …). An enum value this version does not know yet reads as the enum's Unknown/UNK member, or as null, instead of failing.
  • The package is not annotated for trimming or native AOT yet.

More: the quick-start example, the API reference and the repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.14.0 41 11/23/2026
0.13.0 83 11/22/2026
0.12.0 95 11/21/2026
0.11.0 89 11/20/2026
0.10.0 89 11/19/2026
0.9.0 99 11/18/2026
0.8.0 101 11/13/2026
0.7.0 100 11/13/2026
0.6.0 106 11/12/2026
0.5.0 98 11/11/2026
0.3.0 98 11/10/2026
0.2.2 129 10/28/2026
0.2.1 108 10/26/2026
0.2.0 126 10/21/2026
0.1.1 108 10/20/2026
0.1.0 118 10/20/2026