Ticker | SPY |
From | 2020-02-20 00:00:00 |
Security Type | Equity |
Market | USA |
Resolution | Hour |
Status | Resolved |
Hi I can't get hourly data on SPY for Feb 21 using the History method in a research notebook. Can't attach my research notebook but here's the code:
from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Common")
AddReference("QuantConnect.Jupyter")
AddReference("QuantConnect.Indicators")
from System import *
from QuantConnect 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 numpy as np
import pandas as pd
import statsmodels.formula.api as sm
# Create an instance
qb = QuantBook()
spy = qb.AddEquity("SPY") # add equity data
# Lookup today's volume by hour
qb.VolLookup = qb.History(["SPY"], 7, Resolution.Hour)
qb.CurrVol = 0
if not qb.VolLookup.empty:
for i in range(len(qb.VolLookup["volume"])):
qb.CurrVol += qb.VolLookup["volume"].iloc[i]
print('Current Vol: ',qb.VolLookup)
print('Current Vol: ',qb.CurrVol)
JayJayD
Hi Patrick, data is now in place, you can check it here
QuantConnect Robot
JayJayD has marked this issue as closed.
Patrick Chen
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!