Hello colleagues! I am new to quantopian and programming too so dont judge me too hard.
The problem is that I receive an error message: AttributeError: 'Field' object has no attribute 'latest'!
Seems the problem with a factor 'latest'.
I would be very glad to receive any help.
Thank you in advance.
def make_pipeline_2():
#Factor returns
sentiment_factor = sentiment.sentiment_signal.latest
# Our universe is made up of stocks that have a non-null sentiment signal that was updated in
# the last day, are not within 2 days of an earnings announcement, are not announced acquisition
# targets, and are in the Q1500US.
universe = (Q1500US()
& sentiment_factor.notnull())
# A classifier to separate the stocks into quantiles based on sentiment rank.
# Go short the stocks in the 0th quantile, and long the stocks in the 2nd quantile.
pipe = Pipeline(
columns={
'sentiment': sentiment_factor,
'longs': (sentiment_factor >=4),
'shorts': (sentiment_factor<=2),
},
screen=universe
)
return pipe