OPEN-SOURCE SCRIPT
Coefficient of Variance Bars

The script calculates the Coefficient of Variance (CV), which is the standard deviation (a measure of volatility) divided by the average price over a set period. In simple terms, it tells you how volatile the market is in relation to its current price level.
• Highlighting Volatility Increase: By default, the script colors the bars when this relative volatility makes a new high. This suggests that the market is "waking up" and that a significant price move could be starting.
• Highlighting Low Volatility (Inverse Mode): When you uncheck the box in the settings, it highlights periods where volatility is not making a new high. This is useful for spotting quiet, consolidating markets.
________________________________________
How to Use It in Trading
This indicator is a complementary tool and should be used with other forms of analysis, like price action or trend indicators.
1. Spotting Potential Breakouts
The most common use is to anticipate breakouts. When the price is moving in a tight range (consolidation) and you suddenly see a highlighted bar, it signals a surge in volatility. This is often the catalyst that pushes the price out of the range.
• Strategy: Look for a period of price consolidation. When a bar is colored, indicating a volatility spike, look for a confirmation of a breakout (e.g., a candle closing above resistance or below support) and consider entering a trade in that direction.
2. Identifying Ranging Markets
By switching to the inverse mode, you can easily see when the market is quiet and range-bound.
• Strategy: When the bars are consistently highlighted in inverse mode, it confirms a ranging market. This is the ideal environment for strategies that capitalize on sideways movement, such as using oscillators (like RSI or Stochastics) to trade between support and resistance levels.
3. Gauging Trend Strength and Exhaustion
In a strong, ongoing trend, you'll likely see intermittent volatility spikes confirming the momentum. However, a sudden, massive spike in volatility after a very long trend might signal a "climax," potentially indicating the trend is exhausted and a reversal could be near.
• Highlighting Volatility Increase: By default, the script colors the bars when this relative volatility makes a new high. This suggests that the market is "waking up" and that a significant price move could be starting.
• Highlighting Low Volatility (Inverse Mode): When you uncheck the box in the settings, it highlights periods where volatility is not making a new high. This is useful for spotting quiet, consolidating markets.
________________________________________
How to Use It in Trading
This indicator is a complementary tool and should be used with other forms of analysis, like price action or trend indicators.
1. Spotting Potential Breakouts
The most common use is to anticipate breakouts. When the price is moving in a tight range (consolidation) and you suddenly see a highlighted bar, it signals a surge in volatility. This is often the catalyst that pushes the price out of the range.
• Strategy: Look for a period of price consolidation. When a bar is colored, indicating a volatility spike, look for a confirmation of a breakout (e.g., a candle closing above resistance or below support) and consider entering a trade in that direction.
2. Identifying Ranging Markets
By switching to the inverse mode, you can easily see when the market is quiet and range-bound.
• Strategy: When the bars are consistently highlighted in inverse mode, it confirms a ranging market. This is the ideal environment for strategies that capitalize on sideways movement, such as using oscillators (like RSI or Stochastics) to trade between support and resistance levels.
3. Gauging Trend Strength and Exhaustion
In a strong, ongoing trend, you'll likely see intermittent volatility spikes confirming the momentum. However, a sudden, massive spike in volatility after a very long trend might signal a "climax," potentially indicating the trend is exhausted and a reversal could be near.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.