#region imports
from AlgorithmImports import *
#endregion
# First 30 minutes Highest High and Lowest Low
# -------------------------
STOCK = "SPY"; PERIOD = 30;
# -------------------------
class OpeningRangeBreakout(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2021, 12, 6)
self.SetEndDate(2021, 12, 10)
self.SetCash(1000)
self.stock = self.AddEquity(STOCK, Resolution.Minute).Symbol
self.max = self.MAX(self.stock, PERIOD, Resolution.Minute, Field.High)
self.min = self.MIN(self.stock, PERIOD, Resolution.Minute, Field.Low)
self.SetWarmUp(PERIOD, Resolution.Minute)
def OnData(self, data):
if self.IsWarmingUp: return
if not (self.max.IsReady or self.mi.IsReady): return
if self.Time.hour < 10 or self.Time.hour > 10 or self.Time.minute != 31: return
first_30_min_HH = self.max.Current.Value
first_30_min_LL = self.min.Current.Value
self.Log(f"first 30 min Highest High: {first_30_min_HH}")
self.Log(f"first 30 min Lowest Low: {first_30_min_LL}")
self.Plot(STOCK, 'first_30_min_HH', first_30_min_HH)
I am trying to print a log message with the code above.
But the result of the console window after running Backtest is as follows.
No log messages( self.Log(f"first 30 min Highest High: {first_30_min_HH}")
self.Log(f"first 30 min Lowest Low: {first_30_min_LL}")
)are printed. Please help me what to do in this case

Vladimir
Jch
We were not able to recreate the problem you mention.
Check your account settings.
If you are satisfied with my answer, please accept it and don't forget to like it.
Yuri Lopukhov
What you are looking at is the debug log, it only shows messages sent with self.Debug().
self.Log() call will place lines in the backtesting/live log, which is available in the Log tab of the backtest results. Scroll down backtest results page to see the tabs Overview, Report, Orders, Log, etc.
Varad Kabade
Hi jch ,
Failed to reproduce the issue.
Please note that because of vendor limitations, free users are capped to 10kb of logs per backtest with a maximum of 3Mb per day. Users with a subscription can generate up to 100kb of logs per backtest.
Best,
Varad Kabade
Jch
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!