i have used the codes below in jupyter but getting the errors as indicated:
.............................Codes..........................................
from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Common")
AddReference("QuantConnect.Research")
AddReference("QuantConnect.Indicators")
from System import *
from QuantConnect import *
from QuantConnect.Data.Market import TradeBar, QuoteBar
from QuantConnect.Research import *
from QuantConnect.Indicators import *
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import pandas as pd
# Create an instance
qb = QuantBook()
df = qb.History(qb.Securities.Keys, 30, Resolution.Daily)
print(df)
...........................................Errors.........................................
ModuleNotFoundError Traceback (most recent call last) <ipython-input-1-aa9d302cbf0c> in <module> ----> 1 from clr import AddReference 2 AddReference("System") 3 AddReference("QuantConnect.Common") 4 AddReference("QuantConnect.Research") 5 AddReference("QuantConnect.Indicators") ModuleNotFoundError: No module named 'clr'
Jared Broad
Hi John! Is this running the research environment locally? There is no similar issue in QC production
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.
Non Compete
for local dev, should no longer need clr
just use:
from QuantConnect.Research import QuantBookqb = QuantBook()
Make sure you are in the jupyter notebook started by the “lean research” command:
https://www.quantconnect.com/docs/v2/lean-cli/research
I suggest changing the port because default jupyter runs on 8888 and lean research wont give any errors when it runs on 8888
Non Compete
I meant:
Greg Kendall
I'm having the same problem. I've been away for a bit and now QuantBook is not found in the research environment. So I added the
from QuantConnect.Research Import QuantBook
line and now I am getting an error on
CLI not found.
I just started a brand new project (just to make sure it wasn't just my code) and ran the sample research code that is given in a new project that does the Bollinger bands and it is getting the QuantBook error too so it seems something has been broken. Do I need to start a different way?
Greg Kendall
So I restarted from the home page and went back into the lab and created a new project and ran the given Bollinger band research code and low and behold it worked so it looks like my problem may have to do with me running an old version of the website that was in my browsers cache … or something like that.
John Addae
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!