GetSetObjects
Download scriptThis script is designed for MetaTrader users to automate the management and restoration of technical analysis objects—specifically vertical lines, horizontal lines, trend lines, and Fibonacci retracements—on a trading chart. It functions by reading configuration data from an external text file and translating that data into visual elements on your screen.
Here is a breakdown of how the logic works:
Core Functionality
The script acts as a bridge between a saved data file and your live trading chart. Instead of manually drawing every support, resistance level, or trend line, this tool reads a "blueprint" from a text file (named based on the current currency symbol) and constructs those objects automatically.
Operational Modes
The script offers two primary ways to interact with your chart:
- Data Retrieval: The script scans the current chart, identifies specific types of drawing objects, and saves their properties (like price, color, width, and time) into a text file.
- Object Placement: The script reads an existing text file and generates all the corresponding lines and zones on your chart.
Key Features & Logic
- Smart Filtering: The script is programmed to recognize specific objects: Vertical Lines (
V_LINE), Horizontal Lines (H_LINE), Trend Lines (TREND), and Fibonacci levels (FIBO). It ignores other types of drawings to keep the data clean. - Precision Mapping: For every object it finds or creates, it captures detailed metadata, including:
- Visual Styles: Line width, color, and dashed/solid styles.
- Temporal Data: The exact timeframes and coordinates (Price 1, Price 2) where the lines start and end.
- Fibonacci Details: For Fibonacci retracements, it specifically captures the number of levels, the specific values of those levels, and their unique text labels.
- Safety & Confirmation: Before performing a "Delete" action (which clears existing objects to make room for the new data), the script can trigger a pop-up warning message. If the user cancels this warning, the script stops immediately to prevent accidental loss of data.
- Automated Cleanup: When in "Set" mode, it provides an option to automatically remove current chart objects. This ensures that the visual environment is wiped clean before the new data from the file is applied, preventing overlapping or cluttered charts.
Summary for the User
Essentially, this is a backup and restoration system for your technical analysis. It allows you to save your "trading map" into a text file and instantly redeploy that exact same map onto any chart by simply running the script.
ÿþ# p r o p e r t y s c r i p t _ s h o w _ i n p u t s
# i n c l u d e <