Hi,
I have a separate issue about the problem with downloading Option data with Interactive Brokers (IBKR) that is still open. I tried using a IQFeed subscription that also fails with a different error.
Here's the algo to reproduce (C#):
using System;
using QuantConnect;
using QuantConnect.Algorithm;
using QuantConnect.Brokerages;
using QuantConnect.Data;
public class SampleOptionAlgo : QCAlgorithm
{
public override void Initialize()
{
var endDate = DateTime.Today.AddDays(-1);
var startDate = endDate.AddDays(-3);
SetStartDate(startDate);
SetEndDate(endDate);
SetCash(100000);
SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin);
var equity = AddEquity("SPY", Resolution.Minute).Symbol;
Securities[equity].SetDataNormalizationMode(DataNormalizationMode.Raw);
SetBenchmark(equity);
var option = AddOption(equity, Resolution.Minute);
option.SetFilter(-5, 5, TimeSpan.FromDays(20), TimeSpan.FromDays(60));
}
public override void OnData(Slice data)
{
foreach (var (symbol, optionChain) in data.OptionChains)
{
foreach (var option in optionChain)
{
Log($"Received {option}");
}
}
}
}
(1) I made sure to have correct data subscriptions with IQFeed and that they are active.
- DTN IQFeed Core Service
- OPRA
- RT Equity Options-Investor
- NASDAQ Level 1
- NYSE
(2) Installed IQFeed Client (iqfeed_client_6_2_1_20.exe)
(3) Ran `C:\Program Files\DTN\IQFeed\iqlink.exe` and connected the IQFeed Client.
(4) After setting up Lean CLI to use IQFeed, lean.json has the following settings:
```
"id": "IQFeed",
"data-provider": "QuantConnect.Lean.Engine.DataFeeds.DownloaderDataProvider",
"data-downloader": "QuantConnect.Lean.DataSource.IQFeed.IQFeedDataDownloader",
"iqfeed-username": "<iqfeed username>",
"iqfeed-password": "<iqfeed password>",
"iqfeed-productName": "IQFEED_DIAGNOSTICS",
"iqfeed-version": "1.0",
"iqfeed-host": "host.docker.internal",
```
(3) I run the algo with the following command:
```
lean backtest SampleOptionAlgo --data-provider-historical "IQFeed" --backtest-name qc-iqfeed-backtest-01
```
After running the algo, it shows that the stock data for the last 3 days get downloaded but option data fails to download. Also can confirm that from the downloaded files in the data folder.
From the logs:
DATA USAGE:: Total data requests 36
DATA USAGE:: Succeeded data requests 4
DATA USAGE:: Failed data requests 32
There is one error during execution:
20240719 00:41:18.959 ERROR:: IQFeedFileHistoryProvider.ProcessHistoryRequests: Historical data request with
TickType 'Quote' is not supported for resolutions other than Tick. Requested Resolution: Minute
At this point I am blocked again and don't know how to fix this. Can you please help?
Thank you!
P.S.: Here it says “Click Support Request below to submit your discussion as a bug report.” Three is a “Send Support” button on the form that is not working.
Mia Alissi
Hi Omid,
From the information you provided, it seems like the issue is related to the resolution of the data you are trying to download. The error message you received indicates that IQFeed only supports Tick resolution for Quote TickType.
In your algorithm, you are trying to download option data with Minute resolution, which is not supported. You might need to adjust your algorithm to use Tick resolution for options data.
Here is the relevant part of your code that needs to be adjusted:
You should change it to:
Please note that using Tick resolution might significantly increase the amount of data your algorithm needs to process, which could impact its performance.
If you continue to experience issues, I recommend opening a support ticket with QuantConnect, providing all the relevant details for further assistance.
I hope this helps!
Best,
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.
Omid Rad
I need Minute data and Tick data is not supported.
Mia Alissi
Hi Omid,
From the error message you provided, it seems like Tick resolution is not supported for options data in QuantConnect. The supported resolutions for options data are Daily, Hour, and Minute.
This is confirmed by several discussions in the QuantConnect forum. For example, in a discussion about options tutorial, Jared Broad, the CEO of QuantConnect, clarified that they only have option minute data. In another discussion about placing options orders at the second level, he mentioned that the only data they provide for options is at minute-resolution.
Therefore, you should adjust your algorithm to use Minute resolution for options data. Here is the relevant part of your code that needs to be adjusted:
You should change it to:
I hope this helps!
Best,
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.
Omid Rad
Omid Rad
Mia Alissi you're stuck in a loop!
Mia Alissi
I'm sorry to hear that you're having trouble, Omid. Could you please provide more details about the issue you're facing? I'll do my best to assist you.
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.
Omid Rad
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!