I have this code:
class VirtualFluorescentYellowJackal(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2021, 8, 15) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
self.tqqq = self.AddEquity("TQQQ", Resolution.Daily)
# create 21 day EMA of TQQQ
self.ema = self.EMA("TQQQ", 21, Resolution.Daily);
self.SetWarmUp(21)
def OnData(self, data):
self.Debug("ema: " + str(self.ema.Current.Value))
Which works fine in the cloud - but when I run it locally with
lean backtest "Virtual Fluorescent Yellow Jackal"
The output in backtests/2022-02-17_02-07-11/log.txt and 1264635144-log.txt does NOT show any of the debug logs which I see in the cloud terminal.
Why are my Debug logs missing when running locally?
Arthur Asenheimer
Do you have the data for TQQQ stored locally in your data/ directory?
Fred Painchaud
Hi Etay,
Arthur is right - it looks like OnData is never called locally so that would mean you simply do not have the data.
Just so you know, when you run locally, you have LEAN's code, so you have the engine that does the processing/trading - but you do NOT have all the data that's in the cloud. That data is not free to use outside QC's environment.
Fred
Etay Luz
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!