Candlestick MATR
- Indicatori
- Abraham Correa
- Versione: 1.1
Analyze volatility by clicking on a specific candlestick, which triggers the display of horizontal grid lines centered around the candlestick’s closing price, spaced by multiples of the calculated ATR. A vertical line highlights the selected candlestick, and an optional text label can display the ATR value in pips above the candlestick. The indicator is lightweight, using no buffers, and relies on chart objects for visualization. It includes error handling for invalid candlestick selections and adjusts pip calculations for specific symbols (e.g., GOLD, JPY pairs). The design is streamlined, focusing on user interaction via mouse clicks, with customizable visual properties for lines and labels.
Input Parameters
- SelectGrid (enum Select_Grid, default: ATRMode):
- Specifies the grid mode. Currently, only ATRMode (value 0) is supported, which draws an ATR-based grid.
- atr_period (int, default: 7):
- Defines the number of bars used to calculate the ATR for the grid.
- atr_mult (double, default: 2.0):
- Multiplier applied to the ATR value to determine the spacing of grid lines.
- atr_maxpips (double, default: 500):
- Maximum pip range for the ATR value to prevent excessively large grid spacing.
- atr_minpips (double, default: 1):
- Minimum pip range for the ATR value to ensure grid lines are not too close.
- lines_count (int, default: 6):
- Number of grid lines drawn above and below the reference price (total lines: 2 * lines_count + 1).
- lines_color (color, default: Indigo):
- Color of the horizontal grid lines.
- lines_width (int, default: 3):
- Width of the horizontal grid lines (range: 1–5).
- lines_style (ENUM_LINE_STYLE, default: STYLE_SOLID):
- Style of the horizontal grid lines (e.g., solid, dashed).
- vline_color (color, default: Yellow):
- Color of the vertical line highlighting the selected candlestick.
- vline_width (int, default: 1):
- Width of the vertical highlight line (range: 1–5).
- ShowATRValue (bool, default: true):
- Toggles whether the ATR value (in pips) is displayed as a text label above the selected candlestick.
- atr_label_color (color, default: White):
- Color of the ATR value text label.
- atr_label_fontsize (int, default: 10):
- Font size of the ATR value text label.
- tf (ENUM_TIMEFRAMES, default: PERIOD_CURRENT):
- Timeframe for ATR calculations and candlestick selection (default: current chart timeframe).
