Course Name: Decision Trees in Trading, Section No: 6, Unit No: 7, Unit type: Notebook
Hi guys,
After going through several code notebooks, I’m confused about the practice of summing daily returns.
Daily returns defined as percentage changes (df.Close.pct_change()) are multiplicative rather than additive, so summing them should only be an approximation. If the input were log returns, the additivity would make sense.
Is summing simple returns considered acceptable in industry practice, or am I missing something? Any clarification would be appreciated. Thanks!
Hi,
You’ve asked a genuine question here.
For the predictor variables (ret5, ret10, ret20, ret40), here summing is a deliberate approximation. This is done for generating features.
For strategy returns. Summing daily percentage returns is exact for a constant-notional book: you deploy the same fixed capital every day and don’t reinvest P&L. Compounding via cumprod() describes a different book, one that’s fully reinvested. Both conventions are standard in practice, and they answer different questions.
There’s also a reason we can’t simply switch to log returns here. The strategy return is:
data[‘strategy_returns_full_tree’] = data.retFut1 * data.predicted_signal
When the signal is -1, a constant-notional short earns exactly -r before borrow costs, so the multiplication is correct on simple returns. In log space it isn’t, because log(1-r) ≠ -log(1+r). Log returns are additive, but they don’t survive being flipped by a short signal. So the multiply-by-signal idiom needs simple returns. Sharpe is conventionally computed on arithmetic returns as well, so annualized_sharpe_ratio() is fine as it stands.
1 Like
What a nice clarification! It all clicks now. Thinking of it as a constant-notional book is what made everything fall into place. Thank you so much!
1 Like