“Autocorrelation, also known as serial correlation, is the cross-correlation of a signal with itself. Informally, it is the similarity between observations as a function of the time lag between them” – Wikipedia. Autocorrelation value ranges between +1 to -1. Where autocorrelation above zero indicates positive correlation and negative value indicates negative correlation.
Theoretically speaking, Positive Correlation means the time series is trending in the direction of its lagged time series and generally suits for trend trading. whereas the negative correlation mean the time series is mean reverting against the direction of lagged time series and generally suits for mean reversion trading. And if the auto-correlation value of zero represents random movements in stock price.
The code snippets for Amibroker and Tradingview given below
Autocorrelation – Pinescript Code (Tradingview)
You can also access the autocorrelation at tradingview public library
Autocorrelation – AFL Code (Amibroker)