Alright, so I am running into an issue where my algorithm is holding 4 stocks at any time and based on momentum/fundamental analysis they are rotated in and out. The way the algorithm is setup now when a stock is sold it then re-distributes the "cash" over the 4 stocks again - thus if there is 1 stock that doesn't sell it gets money applied to it and making it go over the 25% balance.
Is there a way to ensure my portfolio is always 25% for each stock?