Opportunity costs are sometimes confused with trade-offs, but these two terms have different meanings in economics. A trade-off is what you have to expend in order to pursue an option, while an opportunity cost is what you miss out on by not pursuing a better option.
In the cookie example above, the trade-off for selecting either of the two mystery packages was the same: You paid $1. However, you lost out on two additional cookies by not going with the other package, so there was a significant opportunity cost even though the trade-off was equivalent.
For investments you plan to make in the future, there often won't be a simple, reliably accurate formula for calculating the opportunity cost. This is because you don't know for certain how the assets you are comparing will perform over time.