1. I've paid for a researcher seat to be able to write code locally
  2. I followed this installation instruction: QuantConnect Local Platform Installation Guide for macOS.
  3. I created a new project using the command: lean project-create --language python "Seed Project".
  4. I opened the project in VS Code.
  5. I encountered multiple messages such as:
  • Import "AlgorithmImports" could not be resolved.
  • "QCAlgorithm" is not defined.
  • "Resolution" is not defined.
  • "Slice" is not defined

 

I'm new to the Lean Engine Framework. Could someone advise what have I missed.

Here is my code:

# region imports
from AlgorithmImports import *
# endregion

class SeedProject(QCAlgorithm):

    def Initialize(self):
        # Locally Lean installs free sample data, to download more data please visit https://www.quantconnect.com/docs/v2/lean-cli/datasets/downloading-data
        self.SetStartDate(2013, 10, 7)  # Set Start Date
        self.SetEndDate(2013, 10, 11)  # Set End Date
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("SPY", Resolution.Minute)

    def OnData(self, data: Slice):
        """OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        """
        if not self.Portfolio.Invested:
            self.SetHoldings("SPY", 1)
            self.Debug("Purchased Stock")
176673_1700429032.jpg