Back

Backtesting Python Locally VSCode+Linux

Recently, I posted "VSCode run python strategy offline with Linux". I thought, finally, that I had a working formula, but it failed - again (: 

So I tried, from scratch again:

cloned lean; edited config.json; nuget restore QuantConnect.Lean.sln; msbuild QuantConnect.Lean.sln and mono Launcher/bin/Debug/QuantConnect.Lean.Launcher.exe

Result


Time Elapsed 00:00:31.33
(QConnect) scubamut@scubamut-HP-Laptop-15-db1xxx:~/Repos/Lean$ mono Launcher/bin/Debug/QuantConnect.Lean.Launcher.exe
20200629 10:41:29.131 Trace:: Config.GetValue(): debug-mode - Using default value: False
20200629 10:41:29.137 Trace:: Config.Get(): Configuration key not found. Key: results-destination-folder - Using default value:
20200629 10:41:29.137 Trace:: Config.Get(): Configuration key not found. Key: plugin-directory - Using default value:
20200629 10:41:29.139 Trace:: Config.Get(): Configuration key not found. Key: composer-dll-directory - Using default value: /home/scubamut/Repos/Lean/Launcher/bin/Debug/
20200629 10:41:29.203 Trace:: Python for .NET Assembly: Python.Runtime, Version=1.0.5.30, Culture=neutral, PublicKeyToken=null
20200629 10:41:29.205 Trace:: Config.Get(): Configuration key not found. Key: log-handler - Using default value: CompositeLogHandler
20200629 10:41:29.233 Trace:: Config.Get(): Configuration key not found. Key: data-directory - Using default value: ../../../Data/
20200629 10:41:29.235 Trace:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
20200629 10:41:29.235 Trace:: Config.Get(): Configuration key not found. Key: cache-location - Using default value: ../../../Data/
20200629 10:41:29.235 Trace:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.4.0.0 Mode: DEBUG (64bit)
20200629 10:41:29.235 Trace:: Engine.Main(): Started 10:41 AM
20200629 10:41:29.285 Trace:: Python for .NET Assembly: nPython, Version=1.0.5.30, Culture=neutral, PublicKeyToken=null
20200629 10:41:29.451 Trace:: Config.Get(): Configuration key not found. Key: api-access-token - Using default value:
20200629 10:41:29.453 Trace:: Config.GetValue(): job-user-id - Using default value: 0
20200629 10:41:29.453 Trace:: Config.GetValue(): job-project-id - Using default value: 0
20200629 10:41:29.454 Trace:: Config.Get(): Configuration key not found. Key: algorithm-language - Using default value:

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Must specify valid information for parsing in the string.
at System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument) [0x00023] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00077] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) [0x00010] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.Parse (System.Type enumType, System.String value) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at QuantConnect.Queues.JobQueue..ctor () [0x00040] in <63c28317d274473b8623cad206cd0842>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in <7cd4deb8302a478d9d393f24754841da>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00017] in <7cd4deb8302a478d9d393f24754841da>:0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000a8] in <7cd4deb8302a478d9d393f24754841da>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <7cd4deb8302a478d9d393f24754841da>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00020] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at QuantConnect.Util.Composer.GetExportedValueByTypeName[T] (System.String typeName) [0x000c3] in <6563c1132dc143808996fd73c95b1201>:0
at QuantConnect.Lean.Engine.LeanEngineSystemHandlers.FromConfiguration (QuantConnect.Util.Composer composer) [0x00011] in <688185f010e64a619bd891be5a57c17b>:0
at QuantConnect.Lean.Launcher.Program.Main (System.String[] args) [0x00132] in <dcee284b141a45c2ac830526070d24eb>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Must specify valid information for parsing in the string.
at System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument) [0x00023] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00077] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) [0x00010] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.Parse (System.Type enumType, System.String value) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at QuantConnect.Queues.JobQueue..ctor () [0x00040] in <63c28317d274473b8623cad206cd0842>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in <7cd4deb8302a478d9d393f24754841da>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00017] in <7cd4deb8302a478d9d393f24754841da>:0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x000a8] in <7cd4deb8302a478d9d393f24754841da>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <7cd4deb8302a478d9d393f24754841da>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00020] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at QuantConnect.Util.Composer.GetExportedValueByTypeName[T] (System.String typeName) [0x000c3] in <6563c1132dc143808996fd73c95b1201>:0
at QuantConnect.Lean.Engine.LeanEngineSystemHandlers.FromConfiguration (QuantConnect.Util.Composer composer) [0x00011] in <688185f010e64a619bd891be5a57c17b>:0
at QuantConnect.Lean.Launcher.Program.Main (System.String[] args) [0x00132] in <dcee284b141a45c2ac830526070d24eb>:0

Frustrated, yet again.

There are many posts attempting to solve this and other similar problems, but it never seems to go away.

Is there something I'm doing wrong?  I must be doing something wrong, but what?

I love what has been done by QuantConnect, but I think a step-by-step, repeatable process may help many.

Thank you for all your good work!

Update Backtest







0

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.


Hi Dave! 

It looks like there are no configuration files specified or it can't parse your config json.

>edited config.json; 

Likely this step broke it, can you please post your config?

0

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.


{
// this configuration file works by first loading all top-level
// configuration items and then will load the specified environment
// on top, this provides a layering affect. environment names can be
// anything, and just require definition in this file. There's
// two predefined environments, 'backtesting' and 'live', feel free
// to add more!

"environment": "backtesting", // "live-paper", "backtesting", "live-interactive", "live-interactive-iqfeed"

// algorithm class selector
"algorithm-type-name": "BasicTemplateFrameworkAlgorithm",

// Algorithm language selector - options CSharp, FSharp, VisualBasic, Python, Java
"algorithm-language": "Python",

//Physical DLL location
//"algorithm-location": "QuantConnect.Algorithm.CSharp.dll",
"algorithm-location": "../../../Algorithm.Python/BasicTemplateFrameworkAlgorithm.py",
//"algorithm-location": "QuantConnect.Algorithm.FSharp.dll",
//"algorithm-location": "QuantConnect.Algorithm.VisualBasic.dll",
//"algorithm-location": "QuantConnect.Algorithm.Java.dll",

//Research notebook
//"composer-dll-directory": ".",

// engine
"data-folder": "../../../Data/",

// debugging configuration
"debugging": false,
"debugging-method": "LocalCmdline",

// handlers
"log-handler": "QuantConnect.Logging.CompositeLogHandler",
"messaging-handler": "QuantConnect.Messaging.Messaging",
"job-queue-handler": "QuantConnect.Queues.JobQueue",
"api-handler": "QuantConnect.Api.Api",
"map-file-provider": "QuantConnect.Data.Auxiliary.LocalDiskMapFileProvider",
"factor-file-provider": "QuantConnect.Data.Auxiliary.LocalDiskFactorFileProvider",
"data-provider": "QuantConnect.Lean.Engine.DataFeeds.DefaultDataProvider",
"alpha-handler": "QuantConnect.Lean.Engine.Alphas.DefaultAlphaHandler",
"data-channel-provider": "DataChannelProvider",
"object-store": "QuantConnect.Lean.Engine.Storage.LocalObjectStore",

// limits on number of symbols to allow
"symbol-minute-limit": 10000,
"symbol-second-limit": 10000,
"symbol-tick-limit": 10000,

// limits the amount of data points per chart series. Applies only for backtesting
"maximum-data-points-per-chart-series": 4000,

// if one uses true in following token, market hours will remain open all hours and all days.
// if one uses false will make lean operate only during regular market hours.
"force-exchange-always-open": false,

// save list of transactions to the specified csv file
"transaction-log": "",

// To get your api access token go to quantconnect.com/account
"job-user-id": "<myId>",
"api-access-token": "<myToken",

// live data configuration
"live-data-url": "ws://www.quantconnect.com/api/v2/live/data/",
"live-data-port": 8020,

// interactive brokers configuration
"ib-account": "",
"ib-user-name": "",
"ib-password": "",
"ib-host": "127.0.0.1",
"ib-port": "4002",
"ib-agent-description": "Individual",
"ib-tws-dir": "C:\\Jts",
"ib-trading-mode": "paper",
"ib-enable-delayed-streaming-data": false,

// tradier configuration
"tradier-account-id": "",
"tradier-access-token": "",
"tradier-refresh-token": "",
"tradier-issued-at": "",
"tradier-lifespan": "",
"tradier-refresh-session": true,

// oanda configuration
"oanda-environment": "Practice",
"oanda-access-token": "",
"oanda-account-id": "",

// fxcm configuration
"fxcm-server": "http://www.fxcorporate.com/Hosts.jsp",
"fxcm-terminal": "Demo", //Real or Demo
"fxcm-user-name": "",
"fxcm-password": "",
"fxcm-account-id": "",

// iqfeed configuration
"iqfeed-username": "",
"iqfeed-password": "",
"iqfeed-productName": "",
"iqfeed-version": "1.0",

// gdax configuration
"gdax-api-secret": "",
"gdax-api-key": "",
"gdax-passphrase": "",

// bitfinex configuration
"bitfinex-api-secret": "",
"bitfinex-api-key": "",

// Required to access data from Quandl
// To get your access token go to https://www.quandl.com/account/api
"quandl-auth-token": "",

// Required to access data from Tiingo
// To get your access token go to https://www.tiingo.com
"tiingo-auth-token": "",

// Required to access data from US Energy Information Administration
// To get your access token go to https://www.eia.gov/opendata
"us-energy-information-auth-token": "",

// alpaca configuration
// available trading mode: 'paper', 'live'
"alpaca-key-id": "",
"alpaca-secret-key": "",
"alpaca-trading-mode": "paper",

// parameters to set in the algorithm (the below are just samples)
"parameters": {
// Intrinio account user and password
"intrinio-username": "",
"intrinio-password": "",

"ema-fast": 10,
"ema-slow": 20
},

"environments": {

// defines the 'backtesting' environment
"backtesting": {
"live-mode": false,

"setup-handler": "QuantConnect.Lean.Engine.Setup.ConsoleSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.BacktestingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.FileSystemDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.BacktestingRealTimeHandler",
"history-provider": "QuantConnect.Lean.Engine.HistoricalData.SubscriptionDataReaderHistoryProvider",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler"
},

// defines the 'live-paper' environment
"live-paper": {
"live-mode": true,

// the paper brokerage requires the BacktestingTransactionHandler
"live-mode-brokerage": "PaperBrokerage",

"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"data-queue-handler": "QuantConnect.Lean.Engine.DataFeeds.Queues.LiveDataQueue",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BacktestingTransactionHandler"
},

// defines the 'live-tradier' environment
"live-tradier": {
"live-mode": true,

// this setting will save tradier access/refresh tokens to a tradier-tokens.txt file
// that can be read in next time, this makes it easier to start/stop a tradier algorithm
"tradier-save-tokens": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "TradierBrokerage",
"data-queue-handler": "TradierBrokerage",

"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler"
},

// defines the 'live-interactive' environment
"live-interactive": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "InteractiveBrokersBrokerage",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"data-queue-handler": "QuantConnect.Brokerages.InteractiveBrokers.InteractiveBrokersBrokerage",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "BrokerageHistoryProvider"
},

// defines the 'live-interactive-iqfeed' environment
"live-interactive-iqfeed": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "InteractiveBrokersBrokerage",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"data-queue-handler": "QuantConnect.ToolBox.IQFeed.IQFeedDataQueueHandler",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "QuantConnect.ToolBox.IQFeed.IQFeedDataQueueHandler"
},

// defines the 'live-fxcm' environment
"live-fxcm": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "FxcmBrokerage",
"data-queue-handler": "FxcmBrokerage",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "BrokerageHistoryProvider"
},

// defines the 'live-oanda' environment
"live-oanda": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "OandaBrokerage",
"data-queue-handler": "OandaBrokerage",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "BrokerageHistoryProvider"
},

"live-gdax": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "GDAXBrokerage",
"data-queue-handler": "GDAXDataQueueHandler",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "BrokerageHistoryProvider"
},

"live-bitfinex": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "BitfinexBrokerage",
"data-queue-handler": "BitfinexBrokerage",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "BrokerageHistoryProvider"
},

// defines the 'live-alpaca' environment
"live-alpaca": {
"live-mode": true,

// real brokerage implementations require the BrokerageTransactionHandler
"live-mode-brokerage": "AlpacaBrokerage",
"data-queue-handler": "AlpacaBrokerage",
"setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
"result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
"data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
"real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
"transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
"history-provider": "BrokerageHistoryProvider"
}

}
}

Hi Jared, thanks for your response :)

0

Hi Dave,

The only difference I can find between the config file pasted above and my (working) version is the following lines

"job-user-id": "<myId>",
"api-access-token": "<myToken",

If the same exception is raised when setting these properties to the standard

"job-user-id": "0",
"api-access-token": "",

try using the original config file and only changing the "algorithm-language" and "algorithm-location" for a test with Python.

Best,
Derek Melchin

0

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.


Sorry Derek, I should have mentioned I used my real Id and token for QuantConnect. 

Also tried 

"job-user-id": "0",
"api-access-token": ""

but still got

Time Elapsed 00:00:15.03
(base) scubamut@scubamut-HP-Laptop-15-db1xxx:~/MEGAsync/Projects/Lean$ mono Launcher/bin/Debug/QuantConnect.Lean.Launcher.exe
20200702 13:06:43.167 Trace:: Config.GetValue(): debug-mode - Using default value: False
20200702 13:06:43.174 Trace:: Config.Get(): Configuration key not found. Key: plugin-directory - Using default value:
20200702 13:06:43.176 Trace:: Config.Get(): Configuration key not found. Key: composer-dll-directory - Using default value: /home/scubamut/MEGAsync/Projects/Lean/Launcher/bin/Debug/
20200702 13:06:43.234 Trace:: Python for .NET Assembly: Python.Runtime, Version=1.0.5.30, Culture=neutral, PublicKeyToken=null
20200702 13:06:43.241 Trace:: Python for .NET Assembly: nPython, Version=1.0.5.30, Culture=neutral, PublicKeyToken=null
20200702 13:06:43.247 Trace:: Config.Get(): Configuration key not found. Key: log-handler - Using default value: CompositeLogHandler
20200702 13:06:43.425 Trace:: Config.Get(): Configuration key not found. Key: data-directory - Using default value: ../../../Data/
20200702 13:06:43.435 Trace:: Config.Get(): Configuration key not found. Key: version-id - Using default value:
20200702 13:06:43.435 Trace:: Config.Get(): Configuration key not found. Key: cache-location - Using default value: ../../../Data/
20200702 13:06:43.436 Trace:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v2.4.0.0 Mode: DEBUG (64bit)
20200702 13:06:43.436 Trace:: Engine.Main(): Started 1:06 PM
20200702 13:06:43.443 Trace:: Config.Get(): Configuration key not found. Key: api-access-token - Using default value:
20200702 13:06:43.447 Trace:: Config.GetValue(): job-user-id - Using default value: 0
20200702 13:06:43.447 Trace:: Config.GetValue(): job-project-id - Using default value: 0
20200702 13:06:43.447 Trace:: Config.Get(): Configuration key not found. Key: algorithm-language - Using default value:

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Must specify valid information for parsing in the string.
at System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument) [0x00023] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) [0x00077] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) [0x00010] in <7cd4deb8302a478d9d393f24754841da>:0
at System.Enum.Parse (System.Type enumType, System.String value) [0x00000] in <7cd4deb8302a478d9d393f24754841da>:0
at QuantConnect.Queues.JobQueue..ctor () [0x00040] in <c5bb7bdedf904ed197547d2e80edd329>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in <7cd4deb8302a478d9d393f24754841da>:0
--- End of inner exception stack trace ---

 

0

Hi DaveGilbert ,

Could you please confirm that you could run Lean after a fresh installation?
I mean, before you have modified config.json.
You should be able to run the C# version of BasicTemplateFrameworkAlgorithm.

Everything points to an issue with the config file.
Perhaps the file editor that you used to edit it added invalid characters.

0

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.


In desperation I tried Windows and Visual Studio 19 - cloning Lean, building and backtesting - without problems, for both c# and Python.

So, obviously, I'm doing something wrong with the vscode build process, but I'm a novice using MSBuild...... I suspect PYTHONPATH problems, as I have several conda environments. Any pointers would be welcome :)

If I solve it, I'll report back.....

 

 

0

Hi Dave,

Thank you for offering to report back your findings. The team is working on IDE and docker integration to streamline the process of setting up a local version of LEAN. Our progress can be tracked here.

Best,
Derek Melchin

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed