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
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)