Hi, I would like to create a custom factor which computes a yearly standard deviation of the the ROA (Net Income / Average Total Assets).
I've found a way to calculate this on a daily basis:
class StdDev(CustomFactor):
def compute(self, today, asset_ids, out, values):
out[:] = numpy.nanstd(values, axis=0)
def make_pipeline():
std_dev = StdDev(
inputs=[Fundamentals.roa.latest],
window_length=5
)
return Pipeline(
columns={
'std_dev': std_dev
}
)
any ideas how to change the window_length units to be yearly?
Thanks!