PriceLines
Download scriptThis script is designed to enhance your trading chart by automatically visualizing price levels. It acts as a visual aid, helping traders quickly identify significant price points and currency fluctuations at a glance without having to manually draw dozens of lines.
Core Functionality
The primary purpose of the script is to populate your chart with horizontal lines across a specific price range. Instead of looking at a blank screen, you can see a structured "grid" of price levels that helps in recognizing market structure and historical price action.
Key Features and Logic:
-
Dynamic Price Range (Auto-Range): The script features an intelligent scaling system. If enabled, it looks at the current visible price on your chart and automatically expands the drawing area to encompass enough space for comfortable viewing. It calculates the highest and lowest prices currently shown and creates a buffer zone so that the lines cover the entire visible area dynamically.
-
Hierarchical Line System: The script doesn't just draw identical lines; it distinguishes between "Major" and "Minor" levels:
- Primary Levels: Every time the price hits a specific secondary interval (defined by your settings), the script draws a thicker, more prominent line. This highlights the most significant psychological price barriers.
- Secondary Levels: In between those major points, it draws thinner, dashed lines to represent smaller price increments.
-
Precision Adjustment: The logic includes built-in "smart rounding." It detects how many decimal places your specific currency pair uses (e.g., a 5-digit vs. a 3-digit broker) and adjusts its calculations automatically. This ensures that the lines are placed perfectly on valid price points rather than at awkward fractional numbers.
-
Clean Workspace Management: To ensure your chart stays organized, the script includes a management system. Every time it updates or is refreshed, it identifies and clears out any old lines it previously drew. This prevents "ghost lines" from cluttering your screen, ensuring that only the current, relevant price levels are visible.
Summary of User Experience
When you run this script, you get a clean, organized visual map of the market. It effectively transforms a raw price chart into a structured environment where major resistance and support zones are highlighted clearly, allowing you to focus on currency movements with much less manual effort.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | P r i c e L i n e s . m q 4
/ / | A l e x e y V o l c h a n s k i y
/ / | h t t p : / / m q l . g n o m i o . c o m
/ / |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "