The script allows the user to input a custom range value (default set to 100 points) through the userDefinedRange variable. This value determines the minimum range required for a candle to change color. Calculating Candle Range:
The script calculates the range of each candle by subtracting the low from the high price. Determining Bullish or Bearish Candles:
It checks whether the close price is higher than the open price to determine if a candle is bullish (isBullish variable). Coloring Candles:
Based on the custom range input, the script changes the color of the candles: If the candle's range is greater than or equal to the custom range and it is bullish, the candle color is set to blue (bullishColor). If the range condition is met and the candle is bearish, the color is set to orange (bearishColor). If the range condition is not met, the color is set to na (not applicable). Plotting Colored Candles:
The plotcandle function is used to plot candles with colors based on the custom range and bullish/bearish conditions. The candles will have a higher z-order to be displayed in front of default candles. Displaying High and Low Price Points:
Triangular shapes are plotted at the high and low price levels using the plotshape function, with colors representing bullish (blue) and bearish (orange) conditions. In trading, this indicator can help traders visually identify candles that meet a specific range criteria, potentially signaling strength or weakness in price movements. By customizing the range parameter, traders can adapt the indicator to different market conditions and trading strategies. It can be used in conjunction with other technical analysis tools to make informed trading decisions based on candlestick patterns and price movements.
No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.