PROTECTED SOURCE SCRIPT
[DEM] Relative Strength Signal (With Backtesting)

[DEM] Relative Strength Signal (With Backtesting) is a momentum indicator that generates trading signals based on when an asset reaches its highest or lowest relative strength compared to the SPY benchmark over a 20-period lookback window. The indicator calculates relative strength by dividing the current asset's price by SPY's price, then triggers buy signals when this ratio hits a 20-period high (indicating maximum outperformance) and sell signals when it reaches a 20-period low (indicating maximum underperformance). To prevent signal clustering and improve practical utility, the indicator includes a built-in filter that requires a minimum number of bars (default 20) to pass between signals of the same type, ensuring adequate spacing for meaningful trade opportunities. The system includes comprehensive backtesting functionality that tracks signal accuracy, average returns, and signal frequency over time, displaying these performance metrics in a detailed statistics table to help traders evaluate the effectiveness of trading on relative strength extremes versus the broader market.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.