Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing modules in create-project.py #395

Merged

Conversation

Marinovsky
Copy link
Collaborator

@Marinovsky Marinovsky commented Jan 9, 2024

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):

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");
            }
        }

    }
}

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@Martin-Molinero Martin-Molinero merged commit da77598 into QuantConnect:master Jan 10, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants