Hi,
I have used Indicators like: RSI and PE ratio in my python code, like below: inside Initialize function.
How do I get access to PE ratio inside OnData function. I want to trade based upon PE as a factor along with a few other factors like: RSI and MACD.
It will be helpful if I get any example code.
I have looked at Universe coarse and fine filters, but I am not looking for filtering on PE, I have a set of pre-determined stocks, let's say.
thanks in anticipation.
self.rsi = self.RSI(self.my_stock, 10, MovingAverageType.Simple, Resolution.Daily)
self.macd = self.MACD(self.my_stock, 12, 26, 9, MovingAverageType.Exponential, Resolution.Daily)
Rahul Chowdhury
Hey Suman,
To access fine fundamental data like PE ratios for your securities, you need to implement fine universe selection. One way to use fine universe selection to get fundamental data for a specific set of symbols is to filter your universe by your symbols and then in fine fundamental save the fundamental data for each symbol in a dictionary.
Here's an example.
Suman c
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!