Hi Jim,
Can you elaborate a bit more on what you want your PNF factor to do? I couldn't find a definition for that term after a bit of googling.
Regarding your original question, there isn't a well-supported way to maintain/mutate state on a CustomFactor right now. If it's computationally-feasible to do so, the most straightforward way to do what you're asking within the Pipeline API would be to just recompute the previous day's value each day.
Depending on the particular transformations you're performing on the underlying data, I'd be a bit nervous about comparing Pipeline results from day N to results from day N - 1, because the underlying price/volume values are adjusted for splits/dividends/mergers from day to day, which means comparing today's computed pipeline values to yesterday's isn't always an apples-to-apples comparison.
I'd be curious to hear more about your specific use-case. I've thought a bit about how we might add a sane state-maintenance API to CustomFactors, but hearing specific use-cases helps a lot to ensure that design actually helps solve people's real problems.
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.