OPEN-SOURCE SCRIPT
The MF Rounded Levels

This is a standalone utility indicator designed to draw a custom horizontal grid on your chart. It focuses on "Rounded Levels" (psychological price levels like 1900.00, 1905.00, etc.), which are often significant in trading assets like Gold (XAUUSD).
Here is a breakdown of how it works:
1. Dynamic Visible Range
Smart Drawing: Unlike standard grid tools that might draw lines everywhere, this script calculates the High and Low of the prices currently visible on your screen.
Efficiency: It only draws lines within that specific vertical range. If you scroll the chart, it recalculates and redraws the lines instantly.
2. Two-Tier Grid System
It distinguishes between two types of levels to help you visualize price structure better:
Primary Step: The base increment (default is 5.0). These are the standard grid lines.
Major Step: A larger increment (default is 15.0). These lines overlap with the primary ones but can be styled differently (e.g., thicker, darker, or solid) to mark more significant levels.
3. Customization & Styling
You have full control over the visuals via the settings menu:
Styles: Choose between Solid, Dotted, or Dashed lines.
Colors & Widths: Set different colors and line thicknesses for Primary vs. Major lines.
4. Auto-Hide Feature
Timeframe Filter: The script includes logic to automatically hide the grid if you switch to a timeframe higher than 4 Hours (H4). This prevents the chart from looking cluttered on Daily or Weekly views where 5-point increments would be too dense.
Here is a breakdown of how it works:
1. Dynamic Visible Range
Smart Drawing: Unlike standard grid tools that might draw lines everywhere, this script calculates the High and Low of the prices currently visible on your screen.
Efficiency: It only draws lines within that specific vertical range. If you scroll the chart, it recalculates and redraws the lines instantly.
2. Two-Tier Grid System
It distinguishes between two types of levels to help you visualize price structure better:
Primary Step: The base increment (default is 5.0). These are the standard grid lines.
Major Step: A larger increment (default is 15.0). These lines overlap with the primary ones but can be styled differently (e.g., thicker, darker, or solid) to mark more significant levels.
3. Customization & Styling
You have full control over the visuals via the settings menu:
Styles: Choose between Solid, Dotted, or Dashed lines.
Colors & Widths: Set different colors and line thicknesses for Primary vs. Major lines.
4. Auto-Hide Feature
Timeframe Filter: The script includes logic to automatically hide the grid if you switch to a timeframe higher than 4 Hours (H4). This prevents the chart from looking cluttered on Daily or Weekly views where 5-point increments would be too dense.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.