An error ("EODHD is not defined") occurs when attempting to add data by
self.pmi = self.add_data(EODHDEconomicEvents, EODHD.Events.UnitedStates.MarkitManufacturingPurchasingManagersIndex, Resolution.DAILY).symbolAre macroeconomic indicators still supported in QC?
Attempting to get data from Nasdaq Data Link are also of no result despite I do everything according to the documentation of both QC and Nasdaq DL.
self.can2y = self.add_data(NasdaqDataLink, "BOC/V39051", Resolution.DAILY).symbol
Mia Alissi
Here are two updated and directly compatible QuantConnect example snippets that address both of Michael_S's issues:
1. Using EODHDEconomicEvents (US Manufacturing PMI) — Correct Usage
Tip: If the QC platform introduces named constants/enums in a future release, you can use them instead of the hardcoded string.
2. Using NasdaqDataLink (e.g., BOC/V39051) — Correct Usage
Summary of Solutions
value_column_nameaccordingly, or use.set_value_column_name(symbol, "VALUE")with the baseNasdaqDataLinkclass.Let me know if you need an example with a different ticker or dataset!
Sources: Economic Events - QuantConnect.com, docs writing algorithms securities asset classes us equity data preparation, Gold Market Timing, docs writing algorithms datasets nasdaq data link, docs writing algorithms datasets fred us federal reserve (fred))
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.
Michael_S
Thank you!
I have tried this solution but the problem still in place.
Trying to debug it I still see no data received.
Here is the code used for debugging:
#data_sources
from AlgorithmImports import *
# Helper class to set the correct value column for this series
class BankOfCanadaV39051(NasdaqDataLink):
def __init__(self) -> None:
super().__init__()
self.value_column_name = "VALUE"
# Helper class to set the correct value column for Canada Government 10Y yields
class BankOfCanadaV39055(NasdaqDataLink):
def __init__(self) -> None:
super().__init__()
self.value_column_name = "VALUE"
from data_sources import BankOfCanadaV39051
from AlgorithmImports import *
from datetime import timedelta
class TestBoCData(QCAlgorithm):
def Initialize(self):
self.set_start_date(2023, 1, 1)
self.set_end_date(2023, 12, 31)
self.can2y = self.add_data(BankOfCanadaV39051, "BOC/V39051", Resolution.DAILY).symbol
def OnData(self, data):
history_ = self.History()
self.debug(f"History count: {len(history_)}")
self.debug(f"History keys: {list(history_.index.names) if hasattr(history_, 'index') else 'No index'}")
self.quit()
Michael_S
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!