Hello all,

I am trying to run a local LEAN engine installation on the Kraken Brokerage. I've used the default parameters in QC.Lean.Launcher config.json, set the API key, secret, and verification tier, and set the environment to “live-kraken”. 

After building and running LEAN, I see: 

  1. 20221031 21:54:55.506 ERROR:: JobQueue.NextJob(): Error resolving BrokerageData for live job for brokerage KrakenBrokerage System.InvalidOperationException: Sequence contains no matching element
  2. at System.Linq.ThrowHelper.ThrowNoMatchException()
  3. at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
  4. at QuantConnect.Util.Composer.Single[T](Func`2 predicate) in <lean install dir>\Common\Util\Composer.cs:line 176
  5. at QuantConnect.Queues.JobQueue.NextJob(String& location) in <lean install dir>\Queues\JobQueue.cs:line 157

I also tried referencing QuantConnect.KrakenBrokerage.KrakenBrokerage instead of KrakenBrokerage in the config, and the same error is thrown. 

Here is the configuration (default) for the kraken environment:

  1. "environment": "live-kraken"
  2. // defines the 'live-kraken' environment
  3. "live-kraken": {
  4. "live-mode": true,
  5. // real brokerage implementations require the BrokerageTransactionHandler
  6. "live-mode-brokerage": "KrakenBrokerage",
  7. "data-queue-handler": [ "KrakenBrokerage" ],
  8. "setup-handler": "QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler",
  9. "result-handler": "QuantConnect.Lean.Engine.Results.LiveTradingResultHandler",
  10. "data-feed-handler": "QuantConnect.Lean.Engine.DataFeeds.LiveTradingDataFeed",
  11. "real-time-handler": "QuantConnect.Lean.Engine.RealTime.LiveTradingRealTimeHandler",
  12. "transaction-handler": "QuantConnect.Lean.Engine.TransactionHandlers.BrokerageTransactionHandler",
  13. "history-provider": [ "BrokerageHistoryProvider", "SubscriptionDataReaderHistoryProvider" ]
  14. },

And here is an example of the algorithm I am using for testing:

  1. public class BasicTemplateAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
  2. {
  3. private Symbol _avaxbtc;
  4. public override void Initialize()
  5. {
  6. SetBrokerageModel(BrokerageName.Kraken, AccountType.Cash);
  7. SetCash("BTC", 1); //Set Strategy Cash
  8. _avaxbtc = AddCrypto("AVAXBTC", Resolution.Minute, Market.Kraken).Symbol;
  9. // There are other assets with similar methods. See "Selecting Options" etc for more details.
  10. // AddFuture, AddForex, AddCfd, AddOption
  11. }
  12. /// <summary>
  13. /// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
  14. /// </summary>
  15. /// <param name="data">Slice object keyed by symbol containing the stock data</param>
  16. public override void OnData(Slice data)
  17. {
  18. if (!Portfolio.Invested)
  19. {
  20. SetHoldings(_avaxbtc, 1);
  21. Debug("Purchased AVAX");
  22. }
  23. }
+ Expand

Does anyone know what this error means and what I may be able to do to resolve it? I get the feeling it's something simple that I am missing, but I cannot figure out what it is. 

Author

Miles Child

November 2022