API Installation
NuGet is a package management system integrated into Visual Studio. It makes it easy to install and update packages, including S#.
All S# packages are compiled for .NET 6. This is a cross-platform version (connectors, backtesting, storage, etc. are available in any OS), but graphical components are supported only on Windows.
Public NuGet Server
- Right-click on the project and select Manage NuGet Packages... from the context menu:
- A window will appear as shown in the picture:
- In the search box in the top right corner, type "StockSharp":
- S# is divided into several NuGet packages:
- StockSharp.Algo - basic algorithms and testing
- StockSharp.Binance - connectors to brokers
- StockSharp.Xaml.Charting - graphical components for displaying candlestick charts and indicators
When you select a package, all dependencies will be installed automatically.
- Select the desired package and click Install:
- After installation, S# files will be added to the packages folder and linked as references in the project.
Trading robot examples are available on GitHub.
Private NuGet Server
Some components (like crypto-connectors) are only available through the private NuGet server for registered users.
There are two ways to connect:
Method 1: Authentication via token in the address
Register on the StockSharp website.
Copy the token from your personal account:
- Follow steps 1 and 2 from the Public NuGet Server section and open the available feeds settings window:
- In the window that appears, add a new feed by specifying the address as
https://nuget.stocksharp.com/{token}/v3/index.json
. For example,https://nuget.stocksharp.com/AAHBWDNOINXWNJNWD/v3/index.json
:
- Click OK and select the created feed. If you have access to private components, a list of available NuGet packages will appear:
- Select the desired package and click the Install button.
Method 2: Authentication via username and password
Add a package source with the address
https://nuget.stocksharp.com/x/v3/index.json
.When you try to use this source, an authentication window will appear:
Enter your StockSharp account username and password. You can save your credentials to avoid entering them each time.
After successful authentication, you will have access to private packages.
If you prefer token authentication, you can enter "x" in the username field and your token in the password field.
If you need to reset saved credentials:
- Open "Credential Manager" in Windows (Control Panel → User Accounts → Credential Manager)
- Find VSCredentials related to nuget.stocksharp.com in the list
- Delete these credentials
Package Updates
To check for updates:
- Open Manage NuGet Packages...
- Go to the Updates tab
- Select the packages to update and click Update
Warning
To check for updates on public and private servers, you need to switch the package source, as VS 2019 does not track multiple sources simultaneously.
Installer
Installer is a special application for simplified installation of all StockSharp products.