StockSharp API from Nuget. Manual
Atom Reply
3/6/2015


NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools (integrated into Visual Studio) provide the ability to produce and consume packages, including S#.API.

All S#.API packages are compiled for .NET 4.8 (Windows only, graphic components are supported) and .NET CORE 3.1 (cross-platform version, graphic components are not supported).

Public Nuget server



1. Select project or solution in Solution Explorer window, right click and select Manager Nuget Packages...:

Nuget_0.png


2. Nuget window will appear as below:

Nuget_5.png


3. In the upper right corner in the Search box write StockSharp (case insensitive). The search results appear when you have found a package S#.API as in the picture. Then click to Install:

Nuget_6.png


4. The S#.API platform is divided into many Nuget packages, each of which defines its capabilities. For example, StockSharp.Algo defines basic algorithms and a backtester. StockSharp.InteractiveBrokers broker connector. StockSharp.Xaml.Charting - candlestick and indicator charts.

Choosing one of the specific packages will be automatically downloaded dependencies. There is no need to determine what additional .NET assemblies are required for an installing package.

5. The StockSharp.InteractiveBrokers package was chosen as an example. You must click on the Install button:

Nuget_7.png


6. After installation is complete, in folder packages are placed required S#.API files. Add these files will be added as project references.

7. Samples are located on GitHub.


Private Nuget server



Some of the components are located in a Private NuGet server. This server is available to all registered users, and the availability of certain packages is determined depending on the connectors purchased. For example, all crypto connectors are located only in a Private Nuget server, and only stubs are available in public access on nuget.org.

To connect to the Private server, you need:

1. Pass the registration on the web site.

2. Visit your profile and copy Token:

Nuget_8.png


3. Follow steps 1 and 2 from the Public NuGet server section and open the settings window for available feeds:

Nuget_9.png


4. In the window that appears, add a new feed, specifying the address as https://nuget.stocksharp.com/{token}. For example, https://nuget.stocksharp...E-4FAC-B06D-4652D35CE9CD

Nuget_10.png


5. Press the ОК button and select the created feed. If you have access to certain private components, a list of available NuGet packages will appear:

Nuget_11.png


6. Select the necessary and press the Install button.

7. Downloading a package from a Private server, packages from the public part will be automatically downloaded. For example, StockSharp.Algo, StockSharp.Logging, which is common to most components. There is no need to switch to a public server and download additional packages that a package depends on in a private server.

Get new updates



The NuGet package management allows you to receive new version updates when they are released. To do this, you must similarly go to Manager Nuget Packages... (steps 1 and 2 from the Public Nuget server section) and check for updates in the Updates tab. If available, Visual Studio will show which packages have the new version, and having selected the necessary packages, click the Update button.

Nuget_11.png


To check for updates on the Public and Private servers, you must change the feed in the upper right corner, as shown in step 5 of the Private Nuget server section. VS 2019 cannot track multiple feeds at the same time.

NugetInstaller utility



Nuget_12.png


This utility (NugetInstaller.zip) performs the following functions:

1. Simplified installation MetaTrader connectors. These connectors are divided into client and server parts. The client connects as a regular FIX connector from a Public Nuget server. The server part is installed as an extension to the MetaTrader terminal. To install the server-side, just select the desired connector, the directory where you want to download the files, and click the Start button:

Nuget_13.png


2. To rewrite stub connectors in your own application (trading robot) or in the application such S#.Designer, S#.Terminal, S#.Data etc. Some of the connectors (for example, crypto connectors) are not included in a distribution of apps. Instead, there are stub files that notify a user that they cannot connect to exchange. To simplify the procedure for downloading purchased connectors, you can use the NugetInstaller utility. To do this, select the folder with the program, and click the Start button:

Nuget_14.png



Thanks:




4 Answers
ak

Avatar
Date: 7/21/2015
Reply


Just presented VS2015 Ent:

Install-Package : Could not install package 'StockSharp 4.3.7'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6', but the package does not contain
any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Tried on .net 4.6, 4.5 and even on 4.0 projects - doesn't work, could you check the package?
Thanks:

aristotel

Avatar
Date: 1/4/2016
Reply


Конструктивное обсуждение проблемы приведено здесь https://github.com/NuGet/Home/issues/1542
Thanks:

Victor Montanez

Avatar
Date: 7/16/2017
Reply


Installed on Visual Studio, now any way on how to see sample charts and or using it?
Thanks:

Mikhail Sukhov

Avatar
Articles author Programmer Trader
Date: 7/17/2017
Reply


Our documentation located here https://doc.stocksharp.com
Topic starter
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy