
Python for Algorithmic Trading Cookbook
By :

Returns are integral to understanding the performance of a portfolio. There are two types: simple returns and compound (or log) returns.
Simple returns, which are calculated as the difference in price from one period to the next divided by the price at the beginning of the period, are beneficial in certain circumstances. They aggregate across assets, meaning the simple return of a portfolio is the aggregate of the returns of the individual assets, weighted according to their proportions. This trait makes simple returns practical for comparing assets and evaluating portfolio performance over short-term intervals.
Simple returns are defined as follows:
R t = P t − P t−1 _ P t−1 = P t _ P t−1 − 1
On the other hand, compound returns, which are calculated using the natural logarithm of the price-relative change, are additive over...