trophy

Long Only, ETF Alpha Streams Competition with $27,500 Prize Pool

Back

Documentation discussion research/historical-data

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.


I tried the below code and it ran successfully but returned an empty dataframe.

Can you please check this still works

es = qb.AddFuture("ES")
es.SetFilter(timedelta(0), timedelta(180))
future_history = qb.GetFutureHistory(es.Symbol, datetime(2017, 1, 11, 10, 10), datetime(2017, 1, 13, 12, 10))
future_history.GetAllData()

 

0

Hi,

We've just done an overhaul of our futures data and will have the Research Environment updated soon. Once this is done, this code should work fine, but if you continue to encounter issues with it in the next week, please let us know and we'll do our best to find a solution.

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.


I want to evaluate some ideas on options. But I need the greeks, looks like we can not get them through `option_history.GetAllData()`. How can we get the greeks and IV?

0

Hi Ch9ki7,

In research environment, there is no direct access to those values, therefore you have to calculate on your own. However, we offer those values in backtesting terminal. Here is the usage of option data. Greeks and IV can be accessed as properties of OptionContract object.

Hope it helps!

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 Jack,

I tried the example code for retrieving historical futures data, but when I get all the data nothing prints. Is there a bug for historical futures data?

Thanks,

Brian

2

Hi Brian,

Sorry about the inconvenience, we are aware of the bug and are working on addressing it for the community. Due to the current work in progress, we expect this will be resolved in about 1 week.

2

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.


Thank you, Link! No worries I check back in about a week to try the code again.

2

%matplotlib inline
# Imports
from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Common")
AddReference("QuantConnect.Jupyter")
AddReference("QuantConnect.Indicators")
from System import *
from QuantConnect import *
from QuantConnect.Data.Custom import *
from QuantConnect.Data.Market import TradeBar, QuoteBar
from QuantConnect.Jupyter import *
from QuantConnect.Indicators import *
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import pandas as pd

# Create an instance
qb = QuantBook()

# Select asset data
assets = ["SPY", "EURUSD", "BTCUSD", "GOOG", "ES", "XAUUSD"]

spy = qb.AddEquity("SPY") # add equity data
eur = qb.AddForex("EURUSD") # add forex data
btc = qb.AddCrypto("BTCUSD") # add crypto data
goog = qb.AddOption("GOOG") # add goog options
es = qb.AddFuture("ES") # add SP 500 futures
xau = qb.AddCfd("XAUUSD", Resolution.Minute, Market.Oanda)

# Gets historical data from the subscribed assets, the last 360 datapoints with daily resolution
h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily)

# Plot closing prices from "SPY"
for s in assets:
h1.loc[s]["close"].plot()

fails with error:

the label [GOOG] is not in the [index]

but I suppose that if I use SPY and XAUUSD only it fails as well.

Why is this happening?

0

Islander I think it has to do with this line

h1 = qb.History(qb.Securities.Keys, 360, Resolution.Daily) 

I don't believe the research can handle that much data currently. 

0

We're rebuilding research from scratch. It should be available by the end of next week.

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 Jared, is it possible to have Extended Market Stock data in the Research Environment as I tried to pass it to bo AddEquity and History functions to no avail?

0

Hi Omegab,

Extended market hours data is available in the research environment. I've attached a Research Notebook to show how to implement it. Please check it out.

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