RSI Entries with a Rolling Win-Rate Filter and Fixed Exits
Summary
This script pairs a long-only RSI entry with an optional filter based on recent trade outcomes. Its unfiltered entry occurs when the 14-period RSI crosses below 35. The filter version instead checks a simple candle condition for entry and permits a trade only when the script’s rolling win-rate estimate is above 60%. Position size is set as a percentage of initial capital, with configurable percentage take-profit and stop-loss levels.
The win-rate estimate is built from a separate candle-based simulation: a bearish candle opens a simulated trade, while a bullish candle or a lower close marks its outcome as a win or loss. The script averages these binary outcomes over a configurable number of trades, then plots the estimate. It supplies no reported performance results or comparison showing that the filter improves the RSI strategy. The proxy trades and the actual RSI trades use different entry logic, so the filtered estimate may not represent the strategy’s own expected win rate. The code also does not establish the filter’s robustness across markets or settings.
Key ideas
- The unfiltered strategy enters long when the 14-period RSI crosses below 35.
- The optional filter gates entries using a recent win-rate estimate that must exceed 60%.
- That estimate comes from a separate candle-based simulation rather than the RSI strategy’s own trades.
- Take-profit, stop-loss, position sizing, commission, and slippage settings are configurable or specified in the script.
- No performance evidence is provided to demonstrate that the filter improves results.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.