I have some questions about the custom factor.
How am I able to use the output of one custom factor as the input of another custom factor. For example, I have a few custom factors depending on a window of historic daily cross section residual return, here residual return will be another another custom factor I created separately.
- I tried to create a custom factor derived from another one and use super(), but was warned that super() is not allowed.
- What I can though of is to add the logic for calculating the residual return for each and every other factors that depend on it. But apparently it is redundant and low efficient.
- Let's say I need the past K days residual return for M securities, that would be a K * M matrix. Can I cache the results so that I only need to calculate the last day's residual return and append it to the bottom of this matrix (drop the top line) every day?
Many Thanks, any comment is welcomed.