It checks each candle to see if the open price is equal to either the high or the low of that candle, and if so, it colors the candle purple on the chart.
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 publications is governed by House rules. 您可以收藏它以在圖表上使用。