That SQL should be close, for clients who only hold one item and who don't buy/sell more than one time per day.
The records have to have an explicit order, to deal with multiple transactions per day. As general practice, I always give an autonumber key to every transaction table, because otherwise you can't hang on to a unique reference to that transaction, which complicates updating and comparison. Use sequentially assigned autonumber, not the random option.
Take the following SQL, replace ProductID with whatever field says what the client is buying or selling (maybe InvestmentID?), replace Autokey with the name of the the autonumber field on the Accounts table
Code:
SELECT T1.ClientID, T1.ProductID, T1.MonthlyDate, T1.Autokey, T1.TradePositionX,
(SELECT MAX(T3.MonthlyDate)
FROM Accounts AS T3
WHERE T3.ClientID = T1.ClientID
AND T3.ProductID = T1.ProductID
AND (T3.MonthlyDate < T1.MonthlyDate OR
(T3.MonthlyDate = T1.MonthlyDate AND
T3.AutoKey < T1.Autokey))) AS PriorDate,
(SELECT SUM(T2.TradePositionX)
FROM Accounts AS T2
WHERE T2.ClientID = T1.ClientID
AND T2.ProductID = T1.ProductID
AND T2.MonthlyDate <= T1.MonthlyDate
AND (T2.MonthlyDate < T1.MonthlyDate OR
(T2.MonthlyDate = T1.MonthlyDate AND
T2.AutoKey <= T1.Autokey))) AS NetPosition,
NetPosition - T1.TradePositionX AS BegPosition
FROM Accounts AS T1
ORDER BY T1.ClientID, T1.ProductID, T1.MonthlyDate;