To use C# for research, you must load the Initialize.csx setup script into your notebook. This script loads the QuantConnect libraries into your C# Kernel.
Setup:
In the first cell of your notebook, use the #load directive. In Docker environments, the file is typically one directory above the notebooks directory.
Important Note on Namespaces:
The latest C# research kernel does not support global using statements outside the notebook context. You must add all required Lean namespaces directly via using statements within your notebook cells.
For a practical implementation, refer to the KitchenSinkCSharpQuantBookTemplate.ipynb reference notebook.
#load "../Initialize.csx"
using QuantConnect;
using QuantConnect.Data;
// ... other namespaces