1.Calculate an based on each period's midpoint ((High * Low) /2) for the last 9 periods.
2.Calculate an based on each period's midpoint for the last 100 periods.
3. Divide the difference of the two EMA's by the closing price. ((EMA1 - EMA2) / Close).
4. Smooth the value from step #3 with an 18 period . Multiply by 1000 for better scaling/visibility.
when line is green, when line is red. Buy on first green, then sell on first red.
There is also an option to color the candles based on the RPO line.
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.