OPEN-SOURCE SCRIPT

Previous Candle Sweep Indicator

업데이트됨
This script identifies candlesticks where the current candle's high is higher than the previous candle's high, and the current candle's low is lower than the previous candle's low. If both conditions are met, the candle's body is highlighted in blue on the chart, allowing traders to quickly spot these patterns.

Features:

Highlights candles with both higher highs and lower lows.
Uses clear visual cues (blue body) for easy identification.
Ideal for traders looking to identify specific volatility patterns or reversals.
릴리즈 노트
Customizable Parameters:

Show Percentage (show_percentage): This option allows you to toggle the visibility of the percentage. If set to true, the percentage change will be displayed on the chart; if false, it will not be shown.
Percentage Position (position): This option allows you to select where the percentage will be displayed on the candle. The available options are:
Above: The percentage will be placed above the candle.
Middle: The percentage will be placed in the middle of the candle (between the high and low).
Below: The percentage will be placed below the candle.
Percentage Color (label_color): This option lets you change the text color of the percentage. You can choose any color.
Font Size (label_size): This option allows you to adjust the font size. Available sizes are:
Small: Small text size.
Normal: Standard text size.
Large: Large text size.
Higher Highs and Lower Lows Condition:

The condition that is evaluated is whether the current candle's high is higher than the previous candle's high and the current candle's low is lower than the previous candle's low. This is defined in the variable higher_highs_lows.
If both conditions are true (higher high and lower low), the script proceeds to calculate the percentage and display it.
Percentage Change Calculation:

The difference between the current candle's range and the previous candle's range is calculated:
range_current: The range of the current candle (the difference between the high and low of the candle).
range_previous: The range of the previous candle (the difference between the high and low of the previous candle).
The percentage change between these two ranges is calculated using the formula:
percentage_change = (range_current / range_previous - 1) * 100.
This value is what will be displayed on the chart.
Bar Color Change:

If the higher_highs_lows condition is true, the bar color is changed to blue using barcolor(color.blue). If the condition is not met, no specific color is applied.
Displaying the Percentage:

If the condition is true and the show_percentage option is enabled, the percentage is displayed on the chart:
y_position: Defines the vertical position of the percentage label based on the user selection ("Above", "Middle", or "Below").
label.new: Creates a new label with the percentage text, using the custom settings for font size, color, and text alignment.
x=bar_index: The horizontal position of the label, corresponding to the index of the current bar on the chart.
y=y_position: The vertical position of the label, determined by the chosen position (above, middle, or below the candle).
text: The text to display, which is the percentage calculated with two decimal points.
textcolor: The color of the text, as defined by the user.
size: The font size, which can be small, normal, or large depending on the configuration.
textalign: Text alignment (centered).
Summary of Options:
Show or hide the percentage: The user can choose whether or not to see the percentage change between the current candle's range and the previous candle's range.
Position of the percentage: The percentage can be displayed above, in the middle, or below the candle.
Customization of color and size: The user can adjust the color and size of the percentage text.
This indicator is useful for quickly visualizing how the range of a candle changes compared to the previous one, helping to identify significant market moves.
regressionsVolatilityVolume

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항