Back

Universe selection not as expected and Runtime Error

Hello,

I'm wondering why this algorithm did not trade CBLI, INMB, PRCP, IMV, DARE, or CLBS on 7/14.  I thought it might be because those symbols are not in the top 1,000 dollar volume from the previous day like the coarse universe selection is looking for?  But when I raise the numberOfSymbols field above 1,000, I get a Runtime Error.  Do you know why I'm seeing that error?  And/or why the above symbols did not get traded?

Thanks!
Sean

 

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.


Hi S O’Keeffe,

You are right in that the algorithm changes the tickers it trades based on what is selected by the coarse filter.

The reason why the algorithm gives a Runtime Error with no extra details is most likely because the algorithm ran out of RAM due to the Second Resolution and high number of tickers. At 1000 tickers, the algorithm was on the edge of running out of RAM, so the extra tickers beyond 1000 triggered the RAM limit. 

Best,
Shile Wen

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.


Hi Shile,

Thanks so much for your response!  I'm wondering if there is a way to prevent running out of RAM?

  1. If I upgrade to a different account level, how much does that expand the capacity of RAM for my backtests?
  2. Is there another way to trim the universe or amount of RAM being used?  I want to be looking at all stocks that are up over 10% on the day.  And I need second resolution to make quick entries and exits.  Maybe if I switched to refreshing the list of symbols that are 10%+ every minute instead of every second?  Is the algorithm in its current state refreshing the list of symbols that are 10%+ every second?
  3. Maybe I could switch the universe selection to pick the stocks with the highest short ratio or short float?  Is that a possibility with universe selection?
  4. Any other ideas would be great too!
Thank you,
Sean
0

Hi S O’Keeffe,

  1. With our new Organizations plans, higher RAM nodes are available for purchase. To see the backtest nodes available for purchase, go the “Lab” tab, then head to the “Organization” section, then click “Add Backtest Node”. For users without a plan, please then click “sign up for a plan”, then click the “Customize Plan” tab, then “Build Your Own Pack” in the upper right corner, go under “Backtesting Compute”, and click B2-8 to see the different available backtesting nodes and their respective specification.
  2. An easy way to trim the universe is to only use the first 100 symbols instead of 1000 symbols currently. Finding stocks that are +10% is a possible way to trim the number of symbols. In the current state, the algorithm refreshes the symbols every second, and reducing the resolution will reduce the RAM used.
  3. An example of using the Short Ratio/Interest can be found here.

Best,
Shile Wen

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.


Hi Shile,

OK thank you so much for responding!

  1. I will definitely need to upgrade if this strategy proves worth trading live
  2. I just realized it won't be possible to scan for stocks that are 10%+ on the day in minute resolution, but  make all trades in second resolution will it?  Everything has to be in the same time resolution right?
  3. It looks like that example of using the Short Ratio/Interest isn't compatible for Algorithm Frameworks.  There is no "OnData "section in my algorithm, so I'm not sure how to apply or copy what Jack has done there?
Thank you!
Sean
0

Hi S O’Keeffe,

One is to perform the preliminary filter in coarse, then in OnData, create an empty list, and add to that list symbols filtered for +10% and by Short Interest, then either emit insights for all of those symbols to keep it compatible with the Algorithm Framework. Switching between minute and second resolutions shouldn’t affect whether we can scan for symbols that are +10%.

Best,
Shile Wen

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.


Hi Shile,

Awesome I had not read that "Upgrading Classic Algorithms" section before!  That should be a very helpful tool for potentially switching to Short Ratio/Interest or other factors.  Thank you!

And just to confirm, it's not possible to have one part of the algorithm (scanning for 10%+) working in minute resolution and another part of the algorithm (trade execution) working in second resolution right?  They both have to be in minute resolution or they both have to be in second resolution right?

Thank you!
Sean

0

Hi S O’Keeffe,

It is possible to have Universe Selection (the scanning part) in a different resolution from the trading (presumably in OnData). So the following is valid:

self.AddEquity("W5000", Resolution.Second)
self.UniverseSettings.Resolution = Resolution.Minute

Best,
Shile Wen

1

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.


Oh awesome!  Thank you Shile.  I didn't know that was possible.  I'll see if that can allow me to run some longer backtests

Sean

0

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