Hello, I am trying to create a stock screener where it looks at the top volume stocks trading under $10 and up more than 80% and are on their 52 week high however I am not able to do this. Could someone please provide a screener documentation where it comes all of these parameters. Thanks.
Varad Kabade
Hi Ashmit,
To screen the stock according to the above specification, we should use Coarse universe selection.
To select stocks with 52 weeks high, we use the Maximum indicator. We can define a Maximum indicator with a period of 252 days, the approximate number of trading days in a year. We can also use a SymbolData class to organize the data for our symbols. We can keep all the relevant information for each symbol, like any indicators or rolling windows, in that class. We use the RSI indicator to screen for stocks with RSI values greater than 80. Refer to the attached backtest.
Best,
Varad Kabade
Vidal boreal
It is using the close/adjustprice to calculate the 52 weeks high, but not the “high”.
Louis Szeto
Hi Vidal
Usually, a 52-week high is referring to the highest close price of the past 52 weeks. If we wish to use the `high` attribute, we must subscribe to the security data. That means we must include that in our universe, then we do further filtering. This would suggest a slower backtest than the original method from Varad. Nonetheless, this also represents that we can use a self-updating indicator with `Field.High` to achieve our goal! Please check the attached backtest as an example.
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.
Smnaveen
Hello Louis,
I took your exact main.py code above and ran it from Nov 1 to Nov 30 2021. As u mentioned above, the backtest took a long time, but at the end I did not get any performance chart (see attached backtest ). Looks like the results are empty.
Is there a bug in your code that needs a fix to get proper results ?
thanks.
Smnaveen
Varad Kabade Hello Varad, Seems like Louis Szeto may not be active anymore. Would you be willing to take a stab at my above question? Thanks.
Varad Kabade
Hi Smnaveen,
The condition to enter are never met in the above algorithm resulting in no orders being placed. Therefore, we do not see any strategic metric being created.
Best,
Varad Kabade
Ashmit
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!