Giter VIP home page Giter VIP logo

alpaca-trade-api-csharp's Introduction

Build Codacy Nuget Nuget Nuget Dependabot

.NET SDK for Alpaca Markets API

.NET Core Usage Example

  1. Create a new console application in a new, empty folder by running dotnet new console.
  2. Add a reference for Alpaca .NET SDK with dotnet add package Alpaca.Markets.
  3. Replace content of the auto-generated Programm.cs file with this code snippet:
using System;
using Alpaca.Markets;
using System.Threading.Tasks;

namespace AlpacaExample
{
    internal static class Program
    {
        private const String KEY_ID = "";

        private const String SECRET_KEY = "";

        public static async Task Main()
        {
            var client = Environments.Paper
                .GetAlpacaTradingClient(new SecretKey(KEY_ID, SECRET_KEY));

            var clock = await client.GetClockAsync();

            if (clock != null)
            {
                Console.WriteLine(
                    "Timestamp: {0}, NextOpen: {1}, NextClose: {2}",
                    clock.TimestampUtc, clock.NextOpenUtc, clock.NextCloseUtc);
            }
        }
    }
}
  1. Replace KEY_ID and SECRET_KEY values with your own data from the Alpaca dashboard.
  2. Run the sample application using dotnet run command and check the output. You should see information about the current market timestamp and the times that the market will open and close next.

See the UsageExamples project for near-to-real-world strategy implementation using this SDK and the Alpaca.Markets.Tests repository for SDK usage examples. The Wiki pages contain a lot of additional information about different aspects of this SDK (environments handling, authentication types, different order placement approaches, streaming client subscriptions handling, etc.).

Mapping between branches and SDK versions

Branch Version Description Support Status
develop 5.0.* New features, breaking changes Short-term support version
master 4.1.* All new features and hot-fixes Long-term support version
support/v4.0.x 4.0.* Hot fixes only, some features Critical fixes only

alpaca-trade-api-csharp's People

Contributors

ajit-kolathur avatar biyimaks avatar dependabot-preview[bot] avatar elektromech avatar gjtorikian avatar olegra avatar prometheusuno avatar ronmenator avatar schmich avatar ttt733 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.