OPEN-SOURCE SCRIPT
Autocorrelation with RSI

This indicator uses autocorrelation and RSI to find good entry points for trades. In theory, autocorrelations (correlation of a variable with lagged values) should be a great timing indicator. It goes positive when a trend is confirmed and negative when the trend breaks down so you can use it to follow the trend of play the mean-reversion. But it is not as straightforward as that. If you use autocorrelation to confirm a trend, it would only be helpful if the trend starts slowly (small moves) and then develops into big moves or persistent moves in one direction. If the trend starts with big moves, the autocorrelation will turn positive when most of the move has happened. If you use it for mean-reversion, you need to watch out for noise. You first need to look for evidence that the trend is done using other tools like RSI, momentum indicators, sentiment, fundamental/macro changes, etc, then you can look for entry points using the autocorrelation. Another problem is that you have to decide on a lookback period. RSI uses 14 by default but since few ever change it, then everyone is basically using the same RSI indicators. Since autocorrelation is not a popular indicator, the choice of lookback period matters. You can try to optimize it (fitting past data) but you would likely be overfitting and past performance would be no indicator of future performance.
Note: Autocorrelation is a measure of correlation and therefore has values between -1 and 1, but in this script I change it so that the values are between 0 and 1 to make it fit on the same scale as RSI (for ease of use).
Note: Autocorrelation is a measure of correlation and therefore has values between -1 and 1, but in this script I change it so that the values are between 0 and 1 to make it fit on the same scale as RSI (for ease of use).
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.