C# SDK for Alpaca Trade API https://docs.alpaca.markets/
Branch: master
Clone or download
OlegRa Fixed problem in sample code
Starting from version 1.0.1 SDK provides default values only for `String`-based `RestClient` constructor overload.
Latest commit d17ad29 Dec 31, 2018

README.md

.NET SDK for Alpaca Markets API

.NET Core Usage Example

  1. Create new console application using command dotnet new console in new empty folder.
  2. Add reference for Alpaca .NET SDK using dotnet add package Alpaca.Markets command.
  3. Change Main method in auto-generated Programm.cs file using next code snippet:
var client = new Alpaca.Markets.RestClient(
    KEY_ID, SECRET_KEY, API_URL);

var clock = client.GetClockAsync().Result;

if (clock != null)
{
    Console.WriteLine(
        "Timestamp: {0}, NextOpen: {1}, NextClose: {2}",
        clock.Timestamp, clock.NextOpen, clock.NextClose);
}
  1. Replace KEY_ID, SECRET_KEY and API_URL values with data from web console.
  2. Run sample application using dotnet run command and check output

Use .NET Core configuration

Starting form version 1.1.0 you can use IConfiguration interface for providing configuration data into constructors. You can read more about new .NET Core configuration approach in this article. Read appropriate Wiki pages about expected configuration parameters for each constructor.

Assembly signing in NuGet package

Starting from version 1.2.3 and 2.0.0 NuGet packages contains strongly signed assemblies only for .NET Standard 1.6 and 2.0 targets, .NET Framework 4.5 version of Alpaca.Markets.dll packaged unsigned because dependent assembly NATS.Client.dll also shipped unsigned.