How could I build a CustomFactor() that would select stocks that correspond to the highest and lowest fundamental data, say PE ratio, for each sector? Or maybe two CustomFactors: one to give me the tops and the other to give the bottom ones. That will be easier for me to work with longs and shorts inside pipeline. Any suggestion?