namespace QuantConnect.Algorithm.CSharp
{
public class TestProject : QCAlgorithm
{
public override void Initialize()
{
// Locally Lean installs free sample data, to download more data please visit https://www.quantconnect.com/docs/v2/lean-cli/datasets/downloading-data
SetStartDate(2013, 10, 7); // Set Start Date
SetEndDate(2013, 10, 11); // Set Start Date
SetCash(100000); //Set Strategy Cash
var security = AddEquity("SPY", Resolution.Minute);
var apiResult = new Api.Api();
var pythonResult = new PythonConsolidator();
var statisticsResult = new Statistics.Statistics();
var engineResults = Lean.Engine.Initializer.GetSystemHandlers();
var configurationResult = new CommandLineOption("", McMaster.Extensions.CommandLineUtils.CommandOptionType.SingleValue);
var dataAuxiliaryResult = new ZipEntryName();
var dataShortableResult = new NullShortableProvider();
var ordersTimeInForcesResult = new GoodTilDateTimeInForce(Time);
var securitiesPositionsResult = new Position(security.Symbol, 1, 1);
var ordersOptionExerciseResult = new DefaultExerciseModel();
var securitiesVolatilityResult = new BaseVolatilityModel();
var dataCustomIconicTypesResult = new LinkedData();
var securitiesCryptoFutureResult = new CryptoFutureExchange("bybit");
var signalExportsResult = new SignalExportManager(this);
}
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
/// Slice object keyed by symbol containing the stock data
public override void OnData(Slice data)
{
if (!Portfolio.Invested)
{
SetHoldings("SPY", 1);
Debug("Purchased Stock");
}
}
}
}
The modules added were the ones missing from
AlgorithmImports.py
. Finally, in order to test it was working as expected, the following project was created (using lean cli) and runned in the QC Cloud (see https://www.quantconnect.com/terminal/clone/-/b7f53d2e3947ccea1cd74de843d72435/clone-of%3A-fat-light-brown-fly):