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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.