I have the resolution in my code set to minute, but when I build and run the backtest, my Debug outputs are being displayed every second. I would like the outputs to be displayed every minute, not every second. Is there a way to change this so I can view the backtest output in the same resolution I have set for my code? Thank You.
Alexandre Catarino
When you subscribe securities with a minute resolution usind AddSecurity method (by the way, minute is the default resolution in this case), debug messages generated by the Debug method called in the OnData event handler can only happen every minute. Which method is calling the Debug method?
If you want to share your algorithm, we can have a look at it.
Anton Craft
Thank you. This is the code.
Alexandre Catarino
The rate we receive the messages in the console are indepent of the data resolution. If you add information about the algorithm Time in your output:
public void OnData(TradeBars data) { Debug(Time + "-> Come here"); }
you will see that it has been called every minute (algorithm time) while it shows every second (runtime time). It won't change if you use hour or daily resolution.
Anton Craft
I know it was called every minute. I was just a little confused by seeing the output being printed every second. I wanted to know if there was a way to eliminate the "seconds" part so that I could just focus on what was indicated every minute.
I have run into another related issue. Even though I set the resolution for 1 minute, it only prints once and no more. Here is a code I tested that does this. I think Jared Broad might have touched on this. Please ebnlighten me if that is the case
Anton Craft
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!