LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
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.
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.
Pun Lee
86
,
Here is my code.
0
Rahul Chowdhury
39.9k
,
Hi Pun Lee,
Here's an example of import and accessing "LBMA/GOLD" data from Quandl in the research environment.
class QuandlCustomColumns(PythonQuandl):
'''Custom quandl data type for setting customized value column name. Value column is used for the primary trading calculations and charting.'''
def __init__(self):
self.ValueColumnName = "USD (PM)"
history = qb.History(qb.Securities.Keys, 360, Resolution.Daily)
print(history.loc["LBMA/GOLD"])
It's difficult to debug your code from the pictures provided. Please attach your project to your post. It will be easier to debug why your code is throwing an error.
I've attached an example of retrieving Quandl LBMA/GOLD data in both backtesting and in research.
Best Rahul
0
Pun Lee
86
,
%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.Securities import Futures
from QuantConnect.Jupyter import *
from QuantConnect.Indicators import *
from QuantConnect.Python import PythonQuandl
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# QuantBook Analysis Tool
# For more information see [https://www.quantconnect.com/docs/research/overview]
qb = QuantBook()
#gold spot
class QuandlGold(PythonQuandl):
def __init__(self):
self.ValueColumnName = "USD (PM)"
history = qb.History(qb.Securities.Keys, 360, Resolution.Daily)
print(history.loc['LBMA/GOLD'])
Hi Rahul Chowdhury, thanks so much for your help. I think the solution you provided worked for a while and now when we do history.loc['LBMA/GOLD'], it seems that it could not find the symbol anymore. It seems like Quandl is down some how. Do you know of this issue?
0
Rahul Chowdhury
39.9k
,
Hi Pun Lee,
Sorry for the late response. The issue seems to have resolved itself since I can't reproduce it. If you have any other questions or concerns, please don't hesitate to ask!
Best Rahul
0
Pun Lee
86
,
So you meant that you have no problem fetching Quandl data right?
0
Pun Lee
86
,
Do you think it's because I've reached 'research limits' since I have a free account?
0
Rahul Chowdhury
39.9k
,
Hi Pun Lee,
I didn't have any issue fetching the Quandl data. Are you still experiencing this issue? It may be possible that you're having issues with your access tokens; Quandl rate limits specific tokens. Can you try making a smaller history call? For example, 2 days instead of 360.
history = qb.History(qb.Securities.Keys, 2, Resolution.Daily)
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...
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!