Questions tagged [quantconnect]

18 questions
2
votes
1 answer

Noda time representation for close/open that is an entire day (24 hour period)

I am parsing some interestingly formatted data from https://raw.githubusercontent.com/QuantConnect/Lean/master/Data/market-hours/market-hours-database.json It contains a snippet (removing some days) as below: "Future-cme-[*]": { …
morleyc
  • 2,169
  • 10
  • 48
  • 108
2
votes
1 answer

I'm trying to make a trading bot in Quantconnect based python but I'm getting cannot get managed object

I have seen other threads but couldnt figure it out based on that. class DataConsolidationAlgorithm(QCAlgorithm): def Initialize(self): '''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm.…
GREGOOR
  • 21
  • 1
1
vote
1 answer

Quantconnect: Runtime Error: 'TSLA' wasn't found in the Slice object, likely because there was no-data at this moment

I'm trying to make a script that buy stocks if their price dip 5% in the last 5 minutes. Actually getting a runtime error when I try to run it on Quantconnect. from AlgorithmImports import * # endregion class buyAlgorithm(QCAlgorithm): def…
1
vote
0 answers

Getting docker error 400: client error when trying to run QuantConnect's LEAN engine locally on Ubuntu

I'm simply trying to backtest the starter code provided when creating a new project via the LEAN CLI. When running: lean backtest I get the following error: Error: 400 Client Error for…
Matt
  • 11
  • 1
1
vote
0 answers

Comparing Peak/Trough Values in a Pandas DataFrame

I'm new to pandas and trying to compare peak/trough values in time series price data to determine whether they are higher or lower than the previous peaks/troughs. I'd like to find three consecutively higher peaks and three consecutively higher…
1
vote
1 answer

read_csv differences between different Jupyter Notebooks

I have the following code which works fine in Google Colab, but throws an error when run in QuantConnect's Jupyter Notebook on their site. Any idea why this could be and how to make it work within the QuantConnect notebook? import pandas as pd url…
Ryan Miller
  • 133
  • 9
1
vote
1 answer

Why matplotlib cannot plot multiple lines on the same graph?

I am using an online backtesting platform Quantconnect which use jupyter as their research environment. I have the following codes: fig, ax = plt.subplots() expiry_range = [180, 360]#, 540, 720] for upper in expiry_range: data =…
JOHN
  • 1,411
  • 3
  • 21
  • 41
1
vote
2 answers

QuantConnect/Lean - different indicator values for same resolution using consolidators

I am using the QuantConnect platform to implement some trading strategies and I am currently trying to run some tests on custom time frames (4h, 8h, 12h etc.) using consolidators, but the indicator values differ for the same time resolution using…
1
vote
2 answers

Why am I getting this error? (QuantConnect Algorithm)

I'm just getting started with QuantConnect, but I understand Python fairly well, or so I thought. This is the important part of my code: def Initialize(self): # Set the cash we'd like to use for our backtest # This is ignored in live trading…
Hunter S
  • 25
  • 1
  • 4
0
votes
0 answers

How do I fix this error in Quantconnect (python)

#Directly below is what's in the initialize which I have set up for the 30 and 50 day sma self.sma30 = self.SMA(self.spy, 30, Resolution.Daily) self.sma50 = self.SMA(self.spy, 50, Resolution.Daily) #Below is what's in the OnData which are the lines…
Xavier
  • 1
0
votes
0 answers

Could not import "sktime" library in quantconnect.com though quantconnect supports the library

Lately, I was working on time series forecasting on QuantConnect. In the documentation of QuantConnect, it is mentioned that it the coding environment supports "sktime" library (a python library) but when I tried importing the "sktime" ARIMA…
0
votes
1 answer

How to create an indicator extension with QuantConnect

I have created an indicator for the ratio between PEPSI (PEP) and Coca Cola (COKE) and am trying to create a 5 days simple moving average (sma) from this indicator using IndicatorExtension and then plot the result. The offending code is at the end…
Stacey
  • 4,825
  • 17
  • 58
  • 99
0
votes
1 answer

Docker 0.0.0.0:55555 already in use

I am trying to set Lean engine for python on macos using vscode as described here When I try to run the container, I get docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:55555: bind: address already in use. This is the…
ODelibalta
  • 2,194
  • 1
  • 18
  • 28
0
votes
2 answers

How to split an overridden method into multiple files?

My question is to how to split into multiple files a method containing an override? I understand that this is not possible with partial. In my code, I have too much lines in this method. I code on the QuantConnect platform that limits the size of…
0
votes
1 answer

quantconnect IBController needing to relogin every few hours,

I have updated Ryan Kennedy's IBConnect Docker image by getting the latest versions from Quantconnect, here is the Docker image I ended up with. Basically the dockerfile contains: FROM ubuntu:18.04 MAINTAINER Ryan Kennedy…
1
2