Hey,
I'm new here and just started to run some backtests.
I'm trying to do 2 things and wasn't able to acheived them yet:
1. filter my universe to contain te top 100 losers of the current day.
2. get the currrent change of each share in my universe
I would appreciate your advice, Thanks Ahead!
Shile Wen
Hi Aviv,
If you are trying to implement a top close to close losers algorithm, you can use a dictionary of RateOfChange keyed by Symbol and use a RateOfChange indicator and use CoarseFundamental.AdjustedPrice to update the RateOfChange. This is less tricky than the following method, so I suggest implementing this one first.
Otherwise, for top open to close losers, since Universe Selection occurs outside of market hours, I suggest filtering the universe to a list of stocks outside of the Universe Selection. We can store the opening prices of the securities using a dictionary and manually compute the change in price in OnData or a Scheduled Event.
Best,
Shile Wen
Aviv Alloni
Thank you! I'll defenetly try this.
Another funny question - I wasn't able to create a world without any filter , i.e universe that contains all the available securities.
In all the documentation I read there are some filter. What is the best way to create such universe?
Shile Wen
Hi Aviv,
To create a Universe with no filter, we can simply return [c.Symbol for c in coarse] inside the coarse selection function, and this is demonstrated here. However, please note that adding all Symbols may lead to time out due to the amount of data, as explained here in our docs. Furthermore, to create a Universe based on some filters, I suggest checking the EMA Universe BootCamp as well as the Liquid Value Stocks BootCamp.
Best,
Shile Wen
Aviv Alloni
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!