# How to calculate historical returns and variance for a non-BAH trading strategy?

Suppose i have a strategy that is not buy-and-hold type of strategy. It can have unique entry timing and unique exit timing for a single asset and both long and short positions will be allowed, and sometimes, there may exist some time period where the strategy doesn't have any positions and holds all of it in cash.

Based on this, in order to keep track of that strategy, i would like to calculate the returns and strategy and ultimately sharpe ratio assuming zero risk free rate.

A direct but simple example would be let's say it's been a month since the strategy had 4 trades then do i calculate returns and variance based on those 4 trades?

Or what about this idea of let's say hourly tracking of the total value including unrealized PnL so for those hours with no trades would have 0 returns and 0 variance but even for trade position that lasted 4 hours, it would also track the price changes along those 4 hours, ... etc

The reason i ask about the latter case of calculating the variance, what if strategy A and strategy B are applied to asset A and asset B respectvely. If strategy A had 4 trades on asset A and strategy B had 3 trades on asset B, then how do i calculate returns and variance of this portfolio of A and B? In this case, can i apply the former method by hourly tracking the portfolio value including the unrealized PnL?