Projects
Shared Libraries
Create Libraries
Follow these steps to create a library:
- Create a new project.
- In the project panel, click .
- Click .
- In the Input Library Name field, enter a name for the library (for example, Calculators).
- Click .
- In the right navigation menu, click the Explorer icon.
- In Explorer panel, open the Library.pyLibrary.cs file, rename it to reflect its purpose (e.g.: TaxesCalculator.pyTaxesCalculator.cs), and implement your library.
To create a library directory, set the name to directoryName / libraryName (for example, Tools / Calculators).
The template library files are added to your project. View the files in the Explorer panel.
Add Libraries
Follow these steps to add a library to your project:
- Open the project.
- In the Project panel, click .
- Click the Choose a library... field and then click a library from the drop-down menu.
- Click Calculators). (e.g.
- Import the library into your project to use the library.
The library files are added to your project. To view the files, in the right navigation menu, click the Explorer icon.
using Calculators; namespace QuantConnect.Algorithm.CSharp { public class AddLibraryAlgorithm : QCAlgorithm { private TaxesCalculator _taxesCalculator = new(); } }
from Calculators.TaxesCalculator import TaxesCalculator class AddLibraryAlgorithm(QCAlgorithm): taxes_calculator = TaxesCalculator()
Rename Libraries
To rename a library, open the library project file and then rename the project.
Remove Libraries
Follow these steps to remove a library from your project:
- Open the project that contains the library you want to remove.
- In the Project panel, hover over the library name and then click the trash can icon that appears.
The library files are removed from your project.
Delete Libraries
To delete a library, delete the library project file.