Referencing .NET Libraries/Packages
.NET Libraries¶
cTrader allows for referencing .NET libraries inside the code of cBots and custom indicators. To do so, open the 'Reference Manager' window by clicking on the 'Manage References' button at the top of the code editor.
In the newly opened window, select the 'Browse' tab.
Click on 'Browse', select a locally stored .dll
file and press 'Open'. Afterward, click on 'Apply' to save your changes.
To use your newly imported library, reference the related namespace in your code.
1 2 3 |
|
This will enable you to use classes from your library directly in your code.
1 2 3 4 5 |
|
Nuget Packages¶
You can also reference custom Nuget packages in your cTrader algos. For a detailed example of how to use and install Nuget packages, check out our article on working with external IDEs.
Remember that to install Nuget packages you can use the following tools.
- The
Install-Package
command available in the Nuget package manager console. - The Visual Studio Nuget package manager GUI.
- The .NET CLI.