Hello all,
I am somewhat new to the platform and am discovering unexpected behavior between the algorithm environment and research environment. In particular, it appears that when using the research environment within only one project, I am finding my ObjectStorage segmented, where certain objects are available and certain objects are not, despite that all the objects in question have been saved under the guise of my project. If I run main.py, I can use the self.Debug method to see what's in the object store. Everything seems fine there. But when I open up a research notebook with quantbook, I get inconsistent behavior based on the initialization Quantbook. Certain notebooks have access to some of the objects but not others, and vice versa. Has anyone experienced something like this before? If so, what is the resolution? How can I better control the environment to insure this does not occur in the future? Thank you. Also note, the issue should not be related to memory, I have checked my resources and I have used <25% of total.
Anderson Lidz
In case this question is not clear, the main point is that the self.ObjectStore method within a class inheriting QCAlgorithm within main.py contains all stored elements in the project, while within the research environment qb.ObjectStore (qb for QuantBook object) contains only two elements and is inconsistent between which 2 it shows. Certain .ipynb files show some but not others.
Louis Szeto
Hi AndersonÂ
Have you make sure the object is saved successfully in ObjectStore? The .Save() method will return a boolean indicating that, maybe you could retry and do a check.Â
This also applies to reading the object in ObjectStore. We should always do a check to see if the object name is found by .ContainsKey().Â
Please follow this page for using ObjectStore in research environment, and this page for writing the algorithm.
Best
Louis
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.
Anderson Lidz
Hi Louis,
Thanks for following up with me. The issue seems to be either on my side or pertaining to rather idiosyncratic (and not completly clear) constraints from quantconnect. For example, say I have a main.py file where I save some data and then throw an error afterwards intentionally. I then go to research notebook to open and use said data. This operation works depending on the size of the file (If i understand correctly, free membership has only a 5mb file size limit despite 500mb of free storage, is that correct?). However, what I don't understand is say I run my main.py file again to save different data wrt a different time period. When I open the research notebook afterwards, it appears this dataset has automatically replaced the other and deleted the former, despite them having separate names (this behavior is also inconsistent). Also, my point from the original question has been somewhat clarified, the research notebook was only showing what was actually available. For example, the main script I check all files in object store via self.Debug(str([str(j).split(',')[0][1:] for _, j in enumerate(self.ObjectStore.GetEnumerator())]))
But when I do the same in research.ipynb the results differ. However, the files within the main.py that differ don't actually exist anymore, only in name. I think Quantconnect is automatically deleting them somehow. Anyway, if you can provide any clarifications of this behavior it would be greatly appreciated, because I have read the docs but havent seen anything that explains how I could be experiencing these issues. Anyway, your help is appreciated.
Kind regards,
Anderson
Louis Szeto
Hi Anderson
We will not delete users' data in the ObjectStore. We cannot reproduce this issue. Are you using the same project fot the 2 saved objects? Do you check their existence with the above instruction?
Best
Louis
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.
Anderson Lidz
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!