C:\Users\63036\Desktop\LeanCLI>lean backtest "Energetic Apricot Gorilla" --download-data
Select the organization to purchase and download data with: yi ren
[?1h=20210908 23:00:06.283 TRACE:: Config.Get(): Configuration key not found. Key: plugin-directory - Using default
value:
20210908 23:00:06.291 TRACE:: Composer(): Loading Assemblies from /Lean/Launcher/bin/Debug
20210908 23:00:06.304 TRACE:: Python for .NET Assembly:
QuantConnect.DataSource.ExamplePythonScriptMyCustomDataTypeDoNotUse, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null
20210908 23:00:06.332 TRACE:: Python for .NET Assembly: Python.Runtime, Version=2.0.6.0, Culture=neutral,
PublicKeyToken=5000fea6cba702dd
20210908 23:00:06.350 TRACE:: Config.Get(): Configuration key not found. Key: data-directory - Using default value:
../../../Data/
20210908 23:00:06.353 TRACE:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
20210908 23:00:06.353 TRACE:: Config.Get(): Configuration key not found. Key: cache-location - Using default value:
/Lean/Data
20210908 23:00:06.353 TRACE:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.5.0.0 Mode: DEBUG (64bit) Host:
DESKTOP-IRVG37J
20210908 23:00:06.357 TRACE:: Engine.Main(): Started 11:00 PM
20210908 23:00:06.358 TRACE:: Config.Get(): Configuration key not found. Key: lean-manager-type - Using default value:
LocalLeanManager
20210908 23:00:06.370 TRACE:: JobQueue.NextJob(): Selected /LeanCLI/main.py
20210908 23:00:06.416 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-capacity - Using default value: 120
20210908 23:00:06.417 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-time-interval-minutes - Using default
value: 1440
20210908 23:00:06.417 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-refill-amount - Using default value: 18
20210908 23:00:06.420 TRACE:: Config.Get(): Configuration key not found. Key: data-permission-manager - Using default
value: DataPermissionManager
20210908 23:00:06.429 TRACE:: Config.GetValue(): data-purchase-limit - Using default value:
79228162514264337593543950335
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an
invocation.
---> System.InvalidOperationException: ApiDataProvider(): Must agree to terms at
https://www.quantconnect.com/terms/data/?organization=97092a1c19fb05e80f8da331c1a5b4aa, before using the
ApiDataProvider
at QuantConnect.Lean.Engine.DataFeeds.ApiDataProvider..ctor() in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/DataFeeds/ApiDataProvider.cs:line 92
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean&
canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache,
Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
at QuantConnect.Util.Composer.GetExportedValueByTypeName[T](String typeName) in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Common/Util/Composer.cs:line 259
at QuantConnect.Lean.Engine.LeanEngineAlgorithmHandlers.FromConfiguration(Composer composer) in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/LeanEngineAlgorithmHandlers.cs:line 198
at QuantConnect.Lean.Engine.Initializer.GetAlgorithmHandlers() in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/Initializer.cs:line 78
at QuantConnect.Lean.Launcher.Program.Main(String[] args) in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Launcher/Program.cs:line 72
Error: Something went wrong while running 'Energetic Apricot Gorilla' in the 'backtesting' environment, the output is
stored in 'Energetic Apricot Gorilla\backtests\2021-09-09_07-00-03'
C:\Users\63036\Desktop\LeanCLI>lean backtest "Pensive Magenta Dinosaur" --download-data
Select the organization to purchase and download data with: yi ren
[?1h=20210908 23:03:05.136 TRACE:: Config.Get(): Configuration key not found. Key: plugin-directory - Using default
value:
20210908 23:03:05.144 TRACE:: Composer(): Loading Assemblies from /Lean/Launcher/bin/Debug
20210908 23:03:05.158 TRACE:: Python for .NET Assembly:
QuantConnect.DataSource.ExamplePythonScriptMyCustomDataTypeDoNotUse, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null
20210908 23:03:05.185 TRACE:: Python for .NET Assembly: Python.Runtime, Version=2.0.6.0, Culture=neutral,
PublicKeyToken=5000fea6cba702dd
20210908 23:03:05.206 TRACE:: Config.Get(): Configuration key not found. Key: data-directory - Using default value:
../../../Data/
20210908 23:03:05.209 TRACE:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
20210908 23:03:05.209 TRACE:: Config.Get(): Configuration key not found. Key: cache-location - Using default value:
/Lean/Data
20210908 23:03:05.209 TRACE:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.5.0.0 Mode: DEBUG (64bit) Host:
DESKTOP-IRVG37J
20210908 23:03:05.212 TRACE:: Engine.Main(): Started 11:03 PM
20210908 23:03:05.214 TRACE:: Config.Get(): Configuration key not found. Key: lean-manager-type - Using default value:
LocalLeanManager
20210908 23:03:05.226 TRACE:: JobQueue.NextJob(): Selected /LeanCLI/main.py
20210908 23:03:05.274 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-capacity - Using default value: 120
20210908 23:03:05.274 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-time-interval-minutes - Using default
value: 1440
20210908 23:03:05.275 TRACE:: Config.GetValue(): scheduled-event-leaky-bucket-refill-amount - Using default value: 18
20210908 23:03:05.277 TRACE:: Config.Get(): Configuration key not found. Key: data-permission-manager - Using default
value: DataPermissionManager
20210908 23:03:05.286 TRACE:: Config.GetValue(): data-purchase-limit - Using default value:
79228162514264337593543950335
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an
invocation.
---> System.InvalidOperationException: ApiDataProvider(): Must agree to terms at
https://www.quantconnect.com/terms/data/?organization=97092a1c19fb05e80f8da331c1a5b4aa, before using the
ApiDataProvider
at QuantConnect.Lean.Engine.DataFeeds.ApiDataProvider..ctor() in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/DataFeeds/ApiDataProvider.cs:line 92
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean&
canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor)
at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache,
Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
at QuantConnect.Util.Composer.GetExportedValueByTypeName[T](String typeName) in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Common/Util/Composer.cs:line 259
at QuantConnect.Lean.Engine.LeanEngineAlgorithmHandlers.FromConfiguration(Composer composer) in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/LeanEngineAlgorithmHandlers.cs:line 198
at QuantConnect.Lean.Engine.Initializer.GetAlgorithmHandlers() in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/Initializer.cs:line 78
at QuantConnect.Lean.Launcher.Program.Main(String[] args) in
/LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Launcher/Program.cs:line 72
Error: Something went wrong while running 'Pensive Magenta Dinosaur' in the 'backtesting' environment, the output is
stored in 'Pensive Magenta Dinosaur\backtests\2021-09-09_07-03-01'
class PensiveMagentaDinosaur(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2021, 3, 7) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
self.AddEquity("SPY", Resolution.Minute)
def OnData(self, data):
'''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)
What's wrong with that
Jasper van Merle
Hi Yi,
See this line in the logs:
You need to agree to the CLI API Access and Data Agreement at the provided url before you can download data using the ApiDataProvider.
Yi ren
Thank you! I agreed to the CLI API Access and Data Agreement. But I got new error.
Yi ren
Jasper van Merle
Hi Yi,
This error message means you're trying to download data which isn't part of any of the available datasets. More specifically, the Crypto Price Data dataset only contains Bitfinex and Coinbase data, not Binance.
This error message means that you're trying to download equity data without having an active Security Master subscription. This subscription is necessary before you can purchase and download data from the Security Master, US Equities, US Equity Options or US Coarse Universe datasets.
Yi ren
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!