Hi I am getting familiar with the Lean framework and am trying to test one of the out of the box startegies specifically the "MovingAverageCrossAlgorithm.py". 

In the config.json file I have changed the following.

"environment": "live-alpaca", "alpaca-key-id": "My-ID", "alpaca-secret-key": "My-Secret Key", "alpaca-trading-mode": "paper",

In the MovingAverageCross.py I have set the broker Model to Alpaca.

self.SetBrokerageModel(BrokerageName.Alpaca, AccountType.Cash)

I am not sure if I need to adjust any other settings , when I run the code it doesnt seem to be getting a live data feed. I have tried printing the data to the console using the self.Debug but doesnt show an output.(Below is my output).

Any help is appreciated.

20200727 20:43:14.188 ERROR:: LiveTradingResultHandler.Update(): Algorithm not yet initialized. 20200727 20:43:14.598 Trace:: PythonInitializer.Initialize(): start... PythonEngine.Initialize(): Runtime.Initialize()... Runtime.Initialize(): Py_Initialize... Runtime.Initialize(): PyEval_InitThreads... Runtime.Initialize(): Initialize types... Runtime.Initialize(): Initialize types end. Runtime.Initialize(): AssemblyManager.Initialize()... Runtime.Initialize(): AssemblyManager.UpdatePath()... PythonEngine.Initialize(): register atexit callback... PythonEngine.Initialize(): GetCLRModule()... PythonEngine.Initialize(): clr GetManifestResourceStream... 20200727 20:43:15.678 Trace:: PythonInitializer.Initialize(): ended 20200727 20:43:15.683 Trace:: AlgorithmPythonWrapper(): Python version 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:25:33) [GCC 7.3.0]: Importing python module MovingAverageCrossAlgorithm 20200727 20:43:16.489 Trace:: AlgorithmPythonWrapper(): Creating IAlgorithm instance. 20200727 20:43:17.565 Trace:: Config.GetValue(): mute-python-library-logging - Using default value: True 20200727 20:43:17.623 Trace:: Config.Get(): Configuration key not found. Key: results-destination-folder - Using default value: /root/Lean/Launcher/bin/Debug 20200727 20:43:17.624 Trace:: Config.Get(): Configuration key not found. Key: object-store-root - Using default value: ./storage 20200727 20:43:17.625 Trace:: LocalObjectStore.Initialize(): Storage Root: /root/Lean/Launcher/bin/Debug/storage/QCAlgorithm 20200727 20:43:17.626 Trace:: LiveTradingDataFeed.GetDataChannelProvider(): will use DataChannelProvider 20200727 20:43:17.752 Trace:: Config.GetValue(): websocket-log-trace - Using default value: False 20200727 20:43:17.769 Trace:: LiveTradingDataFeed.GetDataQueueHandler(): will use AlpacaBrokerage 20200727 20:43:17.772 Trace:: BaseDataExchange(DataQueueExchange) Starting... 20200727 20:43:17.775 Trace:: BaseDataExchange(CustomDataExchange) Starting...

 

 

 

Author