This is a lot harder to do.
The history sheet works because Numbers has a built-in function to lookup a given stock ticker on a specific day.
This does not extend to automatically summing multiple stock prices.
It could be extended (e.g. the formula looks up the price of a set of stocks and multiplies by the number of shares held, but it would be a nightmare to track if you're actively trading (adding new stocks and adjusting positions in existing stocks).
If your holdings are fairly static, you could create a rolling 30-day table for each one, then it's a simple SUM() across the tables, but it would still suffer from tracking the number of shares held on a daily basis.