You've successfully subscribed to Alpaca Learn | Developer-First API for Crypto and Stocks
Great! Next, complete checkout for full access to Alpaca Learn | Developer-First API for Crypto and Stocks
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info is updated.
Billing info update failed.
Search
Algorithmic Trading Basics

Best Starting Kits for Algorithmic Trading with C#

Alpaca Team
Alpaca Team

Today, the world is transforming towards automated fashion, including manufacture, cars, marketing and logistics. Personal investment is no exception. At Alpaca, we are pushing this boundary forward so everyone can enjoy the automated investment world.

List of .NET/C# Algo Trading Systems

When it comes to algo trading and automated investment, Python is one of the biggest players in the space, but many experts also use .NET/C# for its high performance and robustness. As we did some research on toolset you might look at to start your algo trading, we wanted to share this list for you.

Overall, the ecosystem has grown so much lately, and many open sources and tools are available for you at low cost, without much equipment.

QuantConnect

QuantConnect is one of the most popular online backtesting and live trading services, where you can learn and experiment your trading strategy to run with the real time market. The platform has been engineered in C# mainly, with additional language coverage such as python.

Design and trade algorithmic trading strategies in a web browser, with free financial data, cloud backtesting and capital - QuantConnect.com
QuantConnect provides a free algorithm backtesting tool and financial data so engineers can design algorithmic trading strategies. We are democratizing algorithm trading technology to empower investors.

WealthLab

WealthLab is a C# platform where you can run your algorithms and auto-trade them. Available features include backtesting, survivorship, walk-forward optimatization, rotation systems and meta-strategies.

NinjaTrader and MultiCharts

NinjaTrader and MultiCharts are also popular choices for different kind of assets with various broker options.

Trading Software & Futures Broker | NinjaTrader
NinjaTrader’s trading software & futures brokerage equips traders with an award-winning trading platform & low commissions for futures trading. Download software or open a futures account.
Trading Software for Backtesting and Automated Trading | MultiCharts Trading Platform
MultiCharts trading software for professional traders with advanced analytics, trading strategies, backtesting and optimization. Trading platform that gives you an edge

OpenSource Projects

In addition to these, StockSharp is an interesting open source project which is tailor for .NET algo traders and broker integrations.

StockSharp/StockSharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins and options). - StockSharp/StockSharp

You should also check out Lean which is an open source library developed by QuantConnect, who also uses this library for their flagship service, supporting multiple assets such as stocks and cryptocurrencies.

QuantConnect/Lean
Lean Algorithmic Trading Engine by QuantConnect (C#, Python, F#) - QuantConnect/Lean

List of Data Library

Deedle

Deedle is probably one of the most useful libraries when it comes to algorithmic trading. You would run some calculation using Frame and compare data, to get signals.

Deedle: Exploratory data library for .NET
Easy to use .NET library for data manipulation and scientific programming

TALibraryInCSharp

TALibraryInCSharp is a great open source library that bridges TA-lib and .NET world, so that you can calculate common indicators such as moving average and RSI. Combining these libraries, you will get the power of trading tools.

DavidFuchs42/TALibraryInCSharp
TA-Lib Converted To C Sharp. Contribute to DavidFuchs42/TALibraryInCSharp development by creating an account on GitHub.

IEX

Now the question is data to calculate those signals on, but if you are talking about US equities, you can leverage IEX’s free data API and there are libraries like IEXTradingApi that makes your life easy for getting the data instantly.

IEX Cloud API | IEX Cloud
IEX Cloud is the easiest way to build financial applications.

Others

There are quite a bit of .NET libraries out there for proprietary data sources (e.g. for Quandl) too, so you should check it out.

lppkarl/Quandl.NET
A .NET wrapper built on Quandl v3 REST API, based on .NET standard 2.0 - lppkarl/Quandl.NET

Announcing Alpaca’s Official .NET Client SDK

Don’t forget about Alpaca! We are committed to providing the best experiences for many algo traders, and today we are happy to announce that our official .NET client SDK for Alpaca Trade API has been released.

Following our Python SDK, .NET SDK takes advantage of its robustness and high performance, as well as wide coverage of platforms. It is an open source project hosted in GitHub and the prebuilt package is up in NuGet. All the classes and methods are documented for IntelliSense so you can get the references right in your IDE.

alpacahq/alpaca-trade-api-csharp
C# SDK for Alpaca Trade API https://docs.alpaca.markets/ - alpacahq/alpaca-trade-api-csharp

Here is a snippet of how easily you can place a buy order of a share of Apple.

using System;
using System.Configuration;
using Alpaca.Markets;

namespace example
{
    class Program
    {
        static void Main(string[] args)
        {
            var client = new Alpaca.Markets.RestClient(
                "APCA-API-KEY-ID", "APCA-API-SECRET-KEY");

            var clock = client.GetClockAsync().Result;

            if (clock != null)
            {
                Console.WriteLine(
                    "Timestamp: {0}, NextOpen: {1}, NextClose: {2}",
                    clock.Timestamp, clock.NextOpen, clock.NextClose);
            }

            var account = client.GetAccountAsync().Result;
            Console.Write("portfolio_value = {0}", account.PortfolioValue);

            if (clock.IsOpen) {
                var order = client.PostOrderAsync("AAPL", 1,
                                                  OrderSide.Buy, OrderType.Market,
                                                  TimeInForce.Day).Result;
                Console.Write("Ordered 1 share of AAPL at {0}", order.SubmittedAt);
            }
        }
    }
}

Alpaca Trade API covers not only retrieving account information and submitting orders, but also allows one to retrieve price and fundamentals information easily. For more details of API, please read our online documents.

Documentation | Alpaca
Alpaca API lets you build and trade with real-time market data for free.
Algorithmic Trading Basics

Alpaca Team

API-first stock brokerage. *Securities are offered through Alpaca Securities LLC* http://alpaca.markets/#disclosures