AdvancedNumeric answer
A signal that sees the future · Part 3 of 3
Six daily closes are 100, 102, 101, 104, 103 and 106 in a pandas Series close. The signal is sig = close > close.rolling(2).mean(), long one unit when true and flat otherwise, and the daily return is ret = close.pct_change(). Daily strategy returns are added, not compounded.
The fix is (sig.shift(1, fill_value=False) * ret).sum(), so each day trades on the previous day’s signal. What total return does it report now, in per cent, to two decimals?
Answer with a number. Fractions, powers and expressions like 23/6 or C(52,5) are read correctly in practice.
The worked solution is in Premium
The answer, the full working and the one idea to take away – for this and all 1,322 questions in the bank. Answer it in practice and your working is marked, with a known mistake named when you make one.
Learn the method
More python and data for quants questions
- An equity curve runs 100, 120, 90, 110. What is the maximum drawdown, as a decimal?Foundation
- A strategy grows $100 to $150 over three years.Foundation
- A strategy wins 40% of trades with an average gain of 3 and loses 60% with an…Foundation
- A strategy has a daily Sharpe ratio of 0.1. What is its annualised Sharpe ratio?Applied
- Your gross Sharpe ratio is 2 and your net Sharpe ratio is 0.1.Applied
- Portfolio weights move from (0.5,0.5) to (0.7,0.3). What is the one-way turnover?Applied