Hi,
I have issues with vscode + docker (local development): All breakpoints get ignored, even in the init method.
I already made a complete fresh setup: download the latest lean, deleted all docker containers/images, did a reset of vscode, but nothing helps. I'm running ubuntu 18.04, vscode 1.56.2.
To start the container I'm executing the run_docker.sh in a terminal and then "Attach to Python (Container"). The script runs through without any errors, but never stops at any breakpoints. Any ideas?
Test with: BasicTemplateDailyAlgorithm.py.
./run_docker.sh
Docker image [default: quantconnect/lean:latest]:
Path to Lean config.json [default: ./Launcher/config.json]:
Path to Data directory [default: ./Data]:
Path to Results directory [default: ./Results]:
Path to Python directory [default: ./Algorithm.Python/]:
Would you like to debug C#? (Requires mono debugger attachment) [default: N]:
Would you like to update the Docker Image? [default: Y]:
./run_docker.sh: Zeile 42: cd: ./Launcher/bin/Debug: Datei oder Verzeichnis nicht gefunden
./run_docker.sh: Zeile 42: cd: ./Launcher/bin/Debug: Datei oder Verzeichnis nicht gefunden
Csharp file at '/QuantConnect.Algorithm.CSharp.dll' does not exist; no CSharp files will be mounted
Error: No such container: LeanEngine
Pulling Docker image: quantconnect/lean:latest
latest: Pulling from quantconnect/lean
Digest: sha256:7ecbce4ef27b66ab6111d4a043f06c85b265fd44974e13ffca74a44f9ea91f86
Status: Image is up to date for quantconnect/lean:latest
docker.io/quantconnect/lean:latest
Launching LeanEngine with command:
docker run --rm --mount type=bind,source=/home/mobert/vc/Lean/Launcher/config.json,target=/Lean/Launcher/config.json,readonly -v /home/mobert/vc/Lean/Data:/Data:ro -v /home/mobert/vc/Lean/Results:/Results --name LeanEngine -p 5678:5678 --expose 6000 --add-host=host.docker.internal:172.17.0.1 -v /home/mobert/vc/Lean/Algorithm.Python:/Lean/Algorithm.Python quantconnect/lean:latest --data-folder /Data --results-destination-folder /Results --config /Lean/Launcher/config.json
20210522 13:20:41.118 TRACE:: Using /Lean/Launcher/config.json as configuration file
20210522 13:20:41.217 TRACE:: Config.GetValue(): debug-mode - Using default value: False
20210522 13:20:41.217 TRACE:: Config.Get(): Configuration key not found. Key: plugin-directory - Using default value:
20210522 13:20:41.236 TRACE:: Config.Get(): Configuration key not found. Key: composer-dll-directory - Using default value: /Lean/Launcher/bin/Debug/
20210522 13:20:41.301 TRACE:: Python for .NET Assembly: Python.Runtime, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5000fea6cba702dd
20210522 13:20:41.311 TRACE:: Python for .NET Assembly: nPython, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null
20210522 13:20:41.321 TRACE:: Config.Get(): Configuration key not found. Key: data-directory - Using default value: ../../../Data/
20210522 13:20:41.323 TRACE:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
20210522 13:20:41.323 TRACE:: Config.Get(): Configuration key not found. Key: cache-location - Using default value: /Data
20210522 13:20:41.323 TRACE:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.5.0.0 Mode: DEBUG (64bit)
20210522 13:20:41.327 TRACE:: Engine.Main(): Started 1:20 PM
20210522 13:20:41.330 TRACE:: Config.Get(): Configuration key not found. Key: lean-manager-type - Using default value: LocalLeanManager
20210522 13:20:41.358 TRACE:: JobQueue.NextJob(): Selected ../../../Algorithm.Python/BasicTemplateDailyAlgorithm.py
20210522 13:20:41.371 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-capacity - Using default value: 120
20210522 13:20:41.371 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-time-interval-minutes - Using default value: 1440
20210522 13:20:41.371 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-refill-amount - Using default value: 18
20210522 13:20:41.372 TRACE:: Config.Get(): Configuration key not found. Key: algorithm-id - Using default value: BasicTemplateDailyAlgorithm
20210522 13:20:41.373 TRACE:: Config.GetValue(): job-project-id - Using default value: 0
20210522 13:20:41.374 TRACE:: Config.Get(): Configuration key not found. Key: data-permission-manager - Using default value: DataPermissionManager
20210522 13:20:41.382 TRACE:: Config.Get(): Configuration key not found. Key: object-store-root - Using default value: ./storage
20210522 13:20:41.384 TRACE:: AlgorithmManager.CreateTokenBucket(): Initializing LeakyBucket: Capacity: 120 RefillAmount: 18 TimeInterval: 1440
20210522 13:20:41.385 TRACE:: Config.GetValue(): algorithm-manager-time-loop-maximum - Using default value: 20
20210522 13:20:41.390 TRACE:: TextSubscriptionDataSourceReader.SetCacheSize(): Setting cache size to 71582788 items
20210522 13:20:41.639 TRACE:: DebuggerHelper.Initialize(): initializing python...
20210522 13:20:41.640 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(): GetCLRModule()...
PythonEngine.Initialize(): clr GetManifestResourceStream...
20210522 13:20:42.672 TRACE:: PythonInitializer.Initialize(): ended
20210522 13:20:42.674 TRACE:: DebuggerHelper.Initialize(): python initialization done
20210522 13:20:42.674 TRACE:: DebuggerHelper.Initialize(): starting...
20210522 13:20:42.674 TRACE:: DebuggerHelper.Initialize(): waiting for PTVSD debugger to attach at localhost:5678...
20210522 13:20:47.923 TRACE:: DebuggerHelper.Initialize(): started
20210522 13:20:47.924 TRACE:: Config.GetValue(): algorithm-creation-timeout - Using default value: 90
20210522 13:20:47.929 TRACE:: AlgorithmPythonWrapper(): Python version 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:25:33)
[GCC 7.3.0]: Importing python module BasicTemplateDailyAlgorithm
20210522 13:20:48.312 TRACE:: AlgorithmPythonWrapper(): BasicTemplateDailyAlgorithm successfully imported.
20210522 13:20:48.315 TRACE:: AlgorithmPythonWrapper(): Creating IAlgorithm instance.
20210522 13:20:48.960 TRACE:: LocalObjectStore.Initialize(): Storage Root: /Lean/Launcher/bin/Debug/storage/QCAlgorithm
20210522 13:20:48.979 TRACE:: BacktestingSetupHandler.Setup(): Setting up job: Plan: Free, UID: 46150, PID: 0, Version: 2.5.0.0, Source: WebIDE
20210522 13:20:48.986 TRACE:: Config.Get(): Configuration key not found. Key: security-data-feeds - Using default value:
20210522 13:20:49.094 TRACE:: BaseSetupHandler.SetupCurrencyConversions():
Symbol Quantity Conversion = Value in USD
USD: $ 100000.00 @ 1.00 = $100000.0
-------------------------------------------------
CashBook Total Value: $100000.0
20210522 13:20:49.096 TRACE:: SetUp Backtesting: User: 46150 ProjectId: 0 AlgoId: BasicTemplateDailyAlgorithm
20210522 13:20:49.097 TRACE:: Dates: Start: 10/08/2013 End: 10/17/2013 Cash: ¤100,000.00
20210522 13:20:49.098 TRACE:: BacktestingResultHandler(): Sample Period Set: 04.00
20210522 13:20:49.099 TRACE:: Time.TradeableDates(): Security Count: 1
20210522 13:20:49.102 TRACE:: Config.GetValue(): forward-console-messages - Using default value: True
20210522 13:20:49.103 TRACE:: JOB HANDLERS:
20210522 13:20:49.103 TRACE:: DataFeed: QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed
20210522 13:20:49.103 TRACE:: Setup: QuantConnect.Lean.Engine.Setup.ConsoleSetupHandler
20210522 13:20:49.103 TRACE:: RealTime: QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler
20210522 13:20:49.103 TRACE:: Results: QuantConnect.Lean.Engine.Results.BacktestingResultHandler
20210522 13:20:49.103 TRACE:: Transactions: QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler
20210522 13:20:49.103 TRACE:: Alpha: QuantConnect.Lean.Engine.Alphas.DefaultAlphaHandler
20210522 13:20:49.103 TRACE:: ObjectStore: QuantConnect.Lean.Engine.Storage.LocalObjectStore
20210522 13:20:49.103 TRACE:: History Provider: QuantConnect.Lean.Engine.HistoricalData.SubscriptionDataReaderHistoryProvider
20210522 13:20:49.115 TRACE:: AlgorithmManager.Run(): Begin DataStream - Start: 10/8/2013 12:00:00 AM Stop: 10/17/2013 11:59:59 PM
20210522 13:20:49.124 TRACE:: Debug: Launching analysis for BasicTemplateDailyAlgorithm with LEAN Engine v2.5.0.0
20210522 13:20:49.164 TRACE:: Config.GetValue(): data-feed-max-work-weight - Using default value: 400
20210522 13:20:49.164 TRACE:: Config.GetValue(): data-feed-workers-count - Using default value: 16
20210522 13:20:49.164 TRACE:: WeightedWorkScheduler(): will use 16 workers and MaxWorkWeight is 400
20210522 13:20:49.180 TRACE:: Config.GetValue(): show-missing-data-logs - Using default value: False
20210522 13:20:49.258 TRACE:: UniverseSelection.AddPendingInternalDataFeeds(): Adding internal benchmark data feed SPY,SPY,Hour,TradeBar,Trade,Adjusted,Internal
20210522 13:20:49.524 TRACE:: Debug: Purchased Stock
20210522 13:20:49.552 TRACE:: Synchronizer.GetEnumerator(): Exited thread.
20210522 13:20:49.553 TRACE:: AlgorithmManager.Run(): Firing On End Of Algorithm...
20210522 13:20:49.554 TRACE:: Engine.Run(): Exiting Algorithm Manager
20210522 13:20:49.557 TRACE:: FileSystemDataFeed.Exit(): Start. Setting cancellation token...
20210522 13:20:49.559 TRACE:: FileSystemDataFeed.Exit(): Exit Finished.
20210522 13:20:49.559 TRACE:: DefaultAlphaHandler.Exit(): Exiting...
20210522 13:20:49.564 TRACE:: DefaultAlphaHandler.Exit(): Ended
20210522 13:20:49.565 TRACE:: BacktestingResultHandler.Exit(): starting...
20210522 13:20:49.565 TRACE:: BacktestingResultHandler.Exit(): Saving logs...
20210522 13:20:49.566 TRACE:: Debug: Algorithm Id:(BasicTemplateDailyAlgorithm) completed in 0.45 seconds at 0k data points per second. Processing total of 73 data points.
20210522 13:20:49.566 TRACE:: Debug: Your log was successfully created and can be retrieved from: /Results/BasicTemplateDailyAlgorithm-log.txt
20210522 13:20:49.566 TRACE:: BacktestingResultHandler.Run(): Ending Thread...
20210522 13:20:49.566 TRACE:: StopSafely(): waiting for 'Result Thread' thread to stop...
20210522 13:20:49.675 TRACE:: Config.GetValue(): regression-update-statistics - Using default value: False
20210522 13:20:49.675 TRACE::
STATISTICS:: Total Trades 1
STATISTICS:: Average Win 0%
STATISTICS:: Average Loss 0%
STATISTICS:: Compounding Annual Return 246.546%
STATISTICS:: Drawdown 1.200%
STATISTICS:: Expectancy 0
STATISTICS:: Net Profit 3.464%
STATISTICS:: Sharpe Ratio 9.933
STATISTICS:: Probabilistic Sharpe Ratio 82.470%
STATISTICS:: Loss Rate 0%
STATISTICS:: Win Rate 0%
STATISTICS:: Profit-Loss Ratio 0
STATISTICS:: Alpha 1.957
STATISTICS:: Beta -0.125
STATISTICS:: Annual Standard Deviation 0.164
STATISTICS:: Annual Variance 0.027
STATISTICS:: Information Ratio -4.577
STATISTICS:: Tracking Error 0.225
STATISTICS:: Treynor Ratio -13.006
STATISTICS:: Total Fees $3.45
STATISTICS:: Estimated Strategy Capacity $970000000.00
STATISTICS:: Lowest Capacity Asset SPY R735QTJ8XC9X
STATISTICS:: Fitness Score 0.112
STATISTICS:: Kelly Criterion Estimate 0
STATISTICS:: Kelly Criterion Probability Value 0
STATISTICS:: Sortino Ratio 53.951
STATISTICS:: Return Over Maximum Drawdown 209.464
STATISTICS:: Portfolio Turnover 0.112
STATISTICS:: Total Insights Generated 0
STATISTICS:: Total Insights Closed 0
STATISTICS:: Total Insights Analysis Completed 0
STATISTICS:: Long Insight Count 0
STATISTICS:: Short Insight Count 0
STATISTICS:: Long/Short Ratio 100%
STATISTICS:: Estimated Monthly Alpha Value $0
STATISTICS:: Total Accumulated Estimated Alpha Value $0
STATISTICS:: Mean Population Estimated Insight Value $0
STATISTICS:: Mean Population Direction 0%
STATISTICS:: Mean Population Magnitude 0%
STATISTICS:: Rolling Averaged Population Direction 0%
STATISTICS:: Rolling Averaged Population Magnitude 0%
STATISTICS:: OrderListHash 33d01821923c397f999cfb2e5b5928ad
20210522 13:20:49.675 TRACE:: BacktestingResultHandler.SendAnalysisResult(): Processed final packet
20210522 13:20:49.676 TRACE:: Engine.Run(): Disconnecting from brokerage...
20210522 13:20:49.676 TRACE:: Engine.Run(): Disposing of setup handler...
20210522 13:20:49.676 TRACE:: Engine.Main(): Analysis Completed and Results Posted.
Engine.Main(): Analysis Complete.
20210522 13:20:49.676 TRACE:: Config.GetValue(): close-automatically - Using default value: False
Engine.Main(): Press any key to continue.
20210522 13:20:49.676 TRACE:: Engine.Main(): Packet removed from queue: BasicTemplateDailyAlgorithm
20210522 13:20:49.676 TRACE:: LeanEngineSystemHandlers.Dispose(): start...
20210522 13:20:49.676 TRACE:: LeanEngineSystemHandlers.Dispose(): Disposed of system handlers.
20210522 13:20:49.676 TRACE:: LeanEngineAlgorithmHandlers.Dispose(): start...
20210522 13:20:49.677 TRACE:: LeanEngineAlgorithmHandlers.Dispose(): Disposed of algorithm handlers.
20210522 13:20:49.678 TRACE:: Program.Main(): Exiting Lean...
Used the “old” approach without Lean CLI. Moved to Lean CLI and now it is working as expected.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!