I have daily close prices of two stocks, A and B. Suppose that we long stock A and short stock B. Assume that we do the long-short every day and hold that portfolio for some days. How to calculate each day's holding period return of this long-short strategy?
My idea is that we first calculate the holding period return for the long position and the short position seperately, then we subtract each day's long position holding period return by the short position holding period return. Is that right?
To calculate long position's hodling period return, I use $$\frac{\text{Final Price_A} - \text{Initial Price_A}}{\text{Initial Price_A}}$$
To calculate short position's holding period return, I use $$\frac{ \text{Initial Price_B} - \text{Final Price_B}}{\text{Initial Price_B}}$$
Then, to find day $k$'s holding period return, I use $$\text{long position's hodling period return} - \text{short position's holding period return}$$
I wanted to post this question on the Finance community of Stack Exchange and Stack Overflow, but they do not let us use LaTex, so I am sorry if this is off-topic here.