I don't know how I can get historical fundamental data and compare today's fundamental to last year's fundamental in FineSelectionFunction. For example, my strategy is as follow:

I'd like ROA today to be greater than ROA last year. If so, I'd add one score to the equity. And then, equites with highest score would be chosen. 

Next, I try to get recent several quarters' ROE and take an average and sort by the average ROE.

In Quantopian, I can do this by Pipeline as below:

class Previous(CustomFactor):
def compute(self, today, asset_ids, out, inputs):
out[:] = inputs[0]

class TargetScore(CustomFactor):
inputs = [
morningstar.operation_ratios.roa,
]
def compute(self, today, asset_ids, out, roa):
score = np.zeros(roa.shape[1])
score += roa[-1] > roa[0]
out[:] = score

def make_pipeline():
score = TargetScore(window_length=252)
score_filter = (score>=1)

roe = morningstar.operation_ratios.roe.latest
roe_last_qtr = Previous(inputs = [morningstar.operation_ratios.roe], window_length = 63)
roe_last_2_qtr = Previous(inputs = [morningstar.operation_ratios.roe], window_length = 63*2)
roe_last_3_qtr = Previous(inputs = [morningstar.operation_ratios.roe], window_length = 63*3)

avg_roe = (roe + roe_last_qtr + roe_last_2_qtr + roe_last_3_qtr)/4

return Pipeline(
columns={
'avg_roe':avg_roe
},
screen = (score_filter)
)

How can I do the same thing in Quantconnect? I noticed some functions like RollingWindow can store previous values for me. But in my case, shouldn't I wait for 252 days before the algorithm works? It's Okay in case of backtesting. But I'd like to put this strategy to live mode. Should I wait 252 days as well before I can trade in live?

Author