Hello!
I am trying to get fundamental data within algorithm, but for some reason use too much memory and get the error:
"Runtime Error: Execution Security Error: Memory Usage Maxed Out - 6192MB max, with last sample of 7950MB" even though i only use one symbol with daily resolution. What might be the issue here?
Found the algo here:
https://www.quantconnect.com/forum/discussion/5570/how-to-get-fundamentals-in-backtesting-outside-of-coursegrainselector-and-finegrainselector-in-c/p1 private Symbol _msft = QuantConnect.Symbol.Create("MSFT", SecurityType.Equity, Market.USA);
public override void Initialize()
{
AddUniverse(coarse => new [] { _msft }, fine => new [] { _msft });
UniverseSettings.Resolution = Resolution.Daily;
SetStartDate(2019, 03, 01);
SetEndDate(2019, 04, 04);
SetCash(50000);
}
public void OnData(TradeBars data)
{
Security msft;
if (Securities.TryGetValue(_msft, out msft))
{
var f = msft.Fundamentals;
if (f != null && f.ValuationRatios.PERatio > 0)
Log($"{Time} :: {f.ValuationRatios.PERatio}");
}
}
Jack Simonson
Hi Robert,
I was unable to reproduce the error you encountered. Can you please attach the backtest that threw this error? This will help us investigate and see what's causing the problem.
RobertKoppel
Hi Jack.
I have attached the backtest.
Alexandre Catarino
Hi RobertKoppel ,
Please call, at least, the SetStartDate method before AddUniverse.
We have created a GitHub issue to address the problem.
RobertKoppel
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!