How to compute estimate performance with variable returns and days held

I have a trading strategy that results in a number of holdings, each of which has a variable number of days held, and obviously, return. So, for example, suppose I run a Monte Carlo simulation, and on average I get the following holdings:

return: 0.01, days held: 5
return: -0.005, days held: 10
return: 0.04, days held: 2
return: 0.002, days held: 7


Assuming that each holding has a fixed percentage of capital allocated to it, how would I go about computing an estimated annual yield, assuming a fixed amount of cash. You can see, for example, that the 2nd holding not only loses money, but it also holds up capital for 10 days. It's not sufficient to simply compute return / day and average them, because of this opportunity cost implication.

Is there an analytical solution to this computation?

You are looking for the internal rate of return. You do have to be careful with it because there will be one root for every time a cash flow switches from an outflow to an inflow and back so if you had an outflow followed by an inflow followed by an outflow you may have two roots. If that is the case, you have to test both roots. You would use the actual dollar values and not returns. Days with no transactions would have zeros. Don't use an inbuilt function such as IRR in Excel as it is not guaranteed to be the true IRR, but instead the first root it found. It runs a search routine and offers you the chance to guess.

You can also do the modified internal rate of return, which assumes you have a fixed reinvestment rate.

EDIT There is no automatic algorithm to account for opportunity costs because there cannot be a market for opportunity costs as they are the things you did not do. In the absense of transactions, no market could form. Additionally, opportunity costs are purely subjective.

By chance, I used to belong to a credit union that happened to have the highest deposit rates in the United States of any financial institution as observed by Bank Rate Monitor in a particular set of weeks. As I was a member, my "risk free" rate was higher than almost any person in the US as it is backed by the full faith and credit of the United States. Unless you happened to live in that county, as it was a geographic credit union, then you could not avail yourself of those rates. As they happened to sit near the corprate investment grade bond rates, it was illogical for me to buy corporate bonds, up to the limit allowed. For a person in a low rate region, their opportunity costs are different.

Likewise, if one of your opportunities is a particular piece of real estate, most individuals will not have those same choices.

Even if, somehow, your opportunity costs were limited to traded assets, you could not use realized returns to measure your opportunity costs as you did not know them at the time you made your choice. You would have to perform estimates on your alternatives and then measure your excess gain given the change in risk.

Now, if your cash investments receive interest or you pay on margin, then the IRR will carry your opportunity costs in it in the implicit change in the amount of cash available at crediting dates. It will not fully reflect your total set of subjective opportunity costs.

You do need to remember, opportunity costs are forward facing and not retrospective. You should be calculating your opportunity costs before the transaction happens.

If you are working prospectively, then your hurdle rate should be your opportunity cost. You can then compare the realizations to your planned rate.

• Thanks Dave, but IRR does not measure opportunity cost. If I compute mean IRR for 100 sample investments, and one investment takes 10% of capital for 100 days, during those 100 days, I only have 90% of capital to trade with. – user1130176 Apr 12 '18 at 11:14
• you have to make an assumption about where the capital is invested when it's not invested in a trade. there are so many days in the year where nothing is being invested in the trades so it needs to be known where that capital is being invested on those days. – mark leeds Jan 7 at 8:28