Best Starting Kits for Algorithmic Trading with C#
Many experts use .NET/C# for its high performance and robustness for algorithmic trading although Python is one of the biggest players in the space.
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.
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.
OpenSource Projects
In addition to these, StockSharp is an interesting open source project which is tailor for .NET algo traders and broker integrations.
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.
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.
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.
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.
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.
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.
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.