Back

SPY, Hour The issue starts from Feb 20th, 2020 12:00 AM; and continues until now

Ticker SPY
From 2020-02-20 00:00:00
Security Type Equity
Market USA
Resolution Hour
Status Waiting Review

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)

 

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.


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