I'm sorry I'm a little slow. Can you just explain the whole N, X, and Sum(P) thing ? Also, are you constantly looking for different stocks to buy each day, based on your criteria?
One other thing, I have not gone through the whole thread, but have you stated which stocks you have bought?