Back

Universe out of memory

Just trying to select 200 securities with second-resolution triggers a memory problem for me. See the super-simple attached code.

I am getting this error:

> Runtime Error: Execution Security Error: Memory Usage Maxed Out - 4096MB max.

And I also get this message:

> We currently only support 30 second at a time due to physical memory limitations

The code illustrates the problem without doing nothing, but what I would like to do is to select securities based on previous day closing price and current day opening price. I understand this is not possible with universe selection, so I need to fetch a broad universe and do the filtering manually on the `OnData` method. Maybe I am just using the wrong approach, but it is weird to me that just selecting 200 securities hits the memory-limit.

 

Update Backtest








Resource limitations are designed to reasonably share compute with the community. Sadly this is just physics :) You're asking for 200 second resolution symbols; it says it only supports 30. Running hundreds of minute resolution symbols works fine -- but second resolution is literally 60x more data. 30*60 is the equivalent to 1800 minute symbols. 200 * 60 is the equivalent to 12,000 minute symbols... We do all the heavy lifting behind the scenes to make it simple for you but using 200 second resolution symbols is a heavy backtest; roughly 200Mb/day of data.

We don't limit what you can do in your algorithm - but we do ensure compute resources are shared in the community. If you'd like more powerful backtesting please submit a feature request to https://www.quantconnect.com/support 

0

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.


I see, thanks for the explanation.

The thing is that I don't really need all that second data, what I would need is a mechanism to constraint the universe once the trading day has started. I think this is not possible with the current API, and it's a common sceneario for intraday strategies, for example:

- Detect gappers from previous day in the first second

- Detect big-range opening bars in the 5th minute

You wouldn't really need all the second data, just a trigger to say "add this filtering at this moment", and then use the second resolution or whatever on the filtered data. Is this possible with the current API?

0

I wonder if one of these 2 workarounds are possible:

1) Have 2 universes, one with "minute" resolution and other one with "second" resolution. Use the first universe to select some stocks and add them to the second universe manually, so that second resolution is only used on a filtered subset.

2) Have 1 low-res universe (e.g: second), after the first X-seconds, remove from the universe all the securities you are not interested in, saving memory that way. 

I have tried to make both approach works with no luck so far, I wonder if what I am trying to achieve is even possible.

 

0

Could you use limit orders placed before market opens? Sorry but I don't think getting more than 30 second symbols is possible on the web platform at the moment. If you use LEAN and run it locally it doesn't have any resource restrictions.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed