Hi all,
I'm new in the world of coding and just jumped on quantopian in the beginning of this week. So far I really like the tutorial content, learning from the expert series and the code sharing of the community etc., which really helps in accelerating the process of getting started here.
However, a major problem I'm facing now is that after having watched a Learn from the experts video or cloning a well-structured notebook all this seems to be too easy and I want to directly jump into coding my ideas into a notebook and research the value of the factors via alphalens....so far this is not working out that well :/
My ultimate goal is to formulate the approach of the markets I'm using in my job as an equity analst, but this seems to be too far away and I'm trying to start step by step with the formulation of easy factors. So to speak I looked at the factset documentation and randomly chose the LongTermConsensus - Price Target data set.
Would anyone here be so kind to help me with creating a rolling "3-months %-change of the price target factor" or even better guide me where I could find a general explanation / approach on how to formulate factors in the CustomFactor-structure?
So far I thought this would do:
class Kursziel(CustomFactor):
price_tgt_cons = LongTermConsensus.slice('PRICE_TGT')
inputs = [price_tgt_cons.mean.latest,RBICSFocus().l2_name]
window_length = 1
window_safe = True
def compute(self,today,assets,out,ziel,sectors):
out[:] = (ziel[-1, :] - ziel[-60, :])/np.abs(ziel[-1, :])
but when running the pipeline I get: "IndexError: index -60 is out of bounds for axis 0 with size 1".
I used Kyle's notebook, which he shared in the Learn from the Experts video (good job and thanks for that!).