I'm new to this kind of matters hence probably this is a stupid question. I would like to build a return time series for backtesting purposes and I was wondering how to handle pv changes when contracts roll, in particular in case of vanilla IMM swaps and vanilla CDSs.
In case of a regular 5Y swap, I would roll it every day and with the curves built at day $t$ I would price the swap I sold in $t-1$ as of $t$, and get the PV difference. It is not clear to me if for standardized contracts such a 5Y-IMM swaps or, even more standardized, a 5Y-CDS, this method can still work.
If someone more experienced on this could share any feedback it would be deeply appreciated.