Calculate the range as the difference between the high and low prices.
The maxRange input to specify the maximum allowable range that defines a sideways market.
The background color is set to blue during sideways market conditions, and it's transparent to some extent (transp=90). When the market is not sideways, the background color is not changed.
The indicator marks the start and end of the session with red triangles.
When the price range (high - low) is within the specified threshold, the indicator will indicate a sideways market with a blue background.
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. Per aggiungerlo al grafico, mettilo tra i preferiti.
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.