Pravin,
CustomFactors
are the right approach. You can pass pipeline terms as inputs to other factors as long as they are 'window safe'. A pipeline term is window_safe
it is comparable across split- or -dividend adjustments. For more on window safety, see this notebook.
My recommendation would be to work on your pipeline in research. It's much easier to iterate on a pipeline in research, and you get more detailed error messages, so it's quicker to debug.
For speed, you will want to provide a mask
to your factors that have any significant computation step. As a starting point, you could start with a StaticAssets
filter to work with a hard-coded set of stocks to test your factors, and then move to a dynamic universe. I suggest this because you could start with a small test group so that your development cycle is faster. The mask
is also very important for cutting down compute time in the CustomFactor
. It won't speed up the step of reading data (the CustomFactor
will always ask for data for all 8000+ securities), but it will restrict any computations after that to being computed over the subset of securities that pass the mask
.
At the end of the day, it sounds like you should end up with a CustomFactor
that takes your other factors as input, and performs some sort of reduction on the arrays of data. Just in case you haven't seen it, the CustomFactor lesson in the Pipeline Tutorial has some detail that might help you to work on the reduction step (e.g. argument types and shapes).
I hope this helps.
Disclaimer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.