API

by StockSharp

API is a free algorithmic trading library for C# and Python. It works in two ways: as code inside Designer — a cube with a script, your own indicator or a scheme element — and as an SDK for your own p...

154.9K Downloads
⭐⭐⭐⭐⭐ Rating
4 Reviews
NuGet 5.0.171 Install-Package StockSharp.Samples -Version 5.0.171
API Screenshot

API is a free algorithmic trading library for C# and Python. It works in two ways: as code inside Designer — a cube with a script, your own indicator or a scheme element — and as an SDK for your own programs, from a console robot to a trading terminal. All of our programs are built on it: Designer, Terminal, Hydra, Shell, Runner and connectors such as MatLab.

74
connections
166
indicators
Free
price

A robot is written in Visual Studio. From connection to order it takes three steps.

1. Connect to a venue

var connector = new Connector();

connector.Adapter.InnerAdapters.Add(new BinanceMessageAdapter(connector.TransactionIdGenerator)
{
	Key = key.Secure(),
	Secret = secret.Secure(),
});

connector.Connect();

2. Subscribe to candles

var subscription = new Subscription(TimeSpan.FromMinutes(5).TimeFrame(), security);

connector.CandleReceived += (sub, candle) =>
{
	if (sub == subscription)
		Console.WriteLine($"{candle.OpenTime:t} {candle.ClosePrice}");
};

connector.Subscribe(subscription);

3. Register an order

connector.RegisterOrder(new Order
{
	Portfolio = portfolio,
	Security = security,
	Side = Sides.Buy,
	Volume = 1,
	Type = OrderTypes.Market,
});

Switching venues means switching the adapter in the first step. The rest of the code stays the same: subscriptions, orders and positions work identically for an exchange, a broker and a crypto exchange.

Designer

schemes and C#

Terminal

trading from the chart

Hydra

data and storage

Shell

robot skeleton

Runner

running on a server

Your own program

the same SDK

API
one library underneath every program
74
connections: exchanges, brokers, crypto, forex

One code base for every market

The robot is not tied to a broker's API: moving from Quik to Transaq, or from forex to a stock exchange, does not rewrite the strategy.

Speed

Order handling inside the library takes microseconds; hundreds of strategies across different instruments run at the same time.

Honest testing

Testing runs on ticks and order books, with slippage and the order queue — not on candle closing prices.

Script or program

The same code can stay a cube inside Designer, or be built into a separate application — the API is the same.


User Reviews

Login to write a review

duc
duc
⭐⭐⭐⭐⭐
5 years ago

test....

Sergey Sokolov
⭐⭐⭐⭐⭐
5 years ago

test

Sergey Sokolov
⭐⭐⭐⭐⭐
5 years ago

test

Sergey Sokolov
⭐⭐⭐⭐⭐
5 years ago

test