Sharpe Ratio Thresholds for Contrarian Long Entries and Exits
Summary
The script describes a long-only strategy driven by the rolling Sharpe ratio of excess returns. It enters when the ratio falls below a low threshold, then sells when the ratio rises above a higher threshold or when the maximum holding period is reached. Returns may be logarithmic or simple; the calculation subtracts a per-period risk-free rate derived from a three-month Treasury yield and scales return and volatility estimates by timeframe.
The accompanying text frames a sharp deterioration in risk-adjusted performance as a potential contrarian buying opportunity, followed by an exit after improvement. The supplied excerpt includes code and illustrative defaults, but no market, backtest period, or performance evidence, and the prose ends mid-sentence. Interpretation depends heavily on the thresholds, rolling window, and bar timeframe. The maximum holding setting is counted in bars, so it does not necessarily represent the same number of calendar days across chart intervals; the external rate series also needs to be available and aligned with the asset data.
Key ideas
- The strategy buys when rolling Sharpe falls below an entry threshold and closes after it exceeds an exit threshold.
- A bar-count holding limit provides another exit condition.
- Sharpe is calculated from returns after subtracting a Treasury-based risk-free rate.
- The script supports logarithmic and simple return calculations and adjusts annualization for chart timeframe.
- The supplied material offers no backtest evidence, and holding duration varies with bar interval.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.