I'm still a little unclear on your requirements. Can you provide the results you are trying to get?
This is a guess and might be the whole thing you're trying to avoid, but what about changing the sort order to ASC on day_id and then using this:
update #DMVRunningPerformance
set
@DailyPerformance=DailyPerf=CASE WHEN @NewGroup_bt=1 THEN 0 ELSE
(MV - @NDMarketValue)/ @NDMarketValue END,
@RunningPerformance=RunningPerf=CASE WHEN @NewGroup_bt=1 THEN 0 ELSE
((1 + @RunningPerformance) * (1 + @DailyPerformance)) - 1 END,
@NDMarketValue=MV,
@NewGroup_bt=0
FROM #DMVRunningPerformance OPTION (MAXDOP 1)