This indicator uses dynamic capabilities of Pinescript version 4 coupled with Random Index (SRI) and Karobein Oscillator (KO). SRI (green/red areas) is employed to detect trends and KO (black curce) is used to find historical similarities to predict the next bar's direction. The midline arrows are the predictions produced by the similarity search algorithm.
The Similarity Search Algorithm is based on the assumption that a centralized osccilator bound to a predefined range of values has got a predictive power. The above algorithm is looking for historical similarity given a stretch of the most recent bars.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.