Back to Community
How to get the right time series

Hey guys,
I am trying to get time series data to built an AI model. I want to make sure that this way is the correct and optimum way to obtain the data. I am asking because -1 and -2 in my perception are representing (in this instance) the value of ROE for two different quarters, but the scatter plot I am getting is indicating that they are the same(or very similar) value.
Any input is appreciated.
Thanks

Loading notebook preview...
Notebook previews are currently unavailable.
4 responses

Hello Ioannis,

Morningstar's roe data is updated quarterly, so you are getting the same value over multiple days because your factor's window length is not large enough to go back to previous quarters.

You will need to increase the window length of each of your factors according to the quarter you are trying to query. In general, you can use 65 as a good estimate for a quarter's length (in trading days). Attached you will find a copy of your notebook where I have updated Roe2 and Roe3 to query values for the previous two quarters.

I hope this helps.

Loading notebook preview...
Notebook previews are currently unavailable.
Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

Got it,
thanks Ernesto

Hey,
Still in my quest to properly construct a dataset inclusive of fundamentals and technical indicators.
Roughly speaking the following function obtains an indication of how much a security has move during the most current quarter (zero indicates today)

class Momentum(CustomFactor):
inputs = [USEquityPricing.close]
window_length = 252
def compute(self, today, assets, out, close):
out[:] = close[-65] / close[0]

If I want to find the move over the previous quarter, is this the correct way to go about it?
class Momentum(CustomFactor):
inputs = [USEquityPricing.close]
window_length = 252
def compute(self, today, assets, out, close):
out[:] = close[-130] / close[-65]

I feel like something is not right. Can someone please verify that I am doing the right thing?

Thanks

Hi Ioannis,

Actually, the most recent value would correspond to close[-1]. close[0] corresponds to the value at the start of the window, which would be 252 days ago.

Other than that, both factors look ok.