Move_Trand_line
Download scriptThis script is designed as a utility tool for the MetaTrader 5 trading platform. Its primary purpose is to automatically reposition existing trend lines on your trading chart based on specific user-defined parameters.
Instead of manually dragging every line on your screen, this tool automates the process by scanning your chart and applying uniform adjustments to the "anchor points" (the start and end coordinates) of all trend lines simultaneously.
Core Functionality
The logic follows a systematic workflow once executed:
- Scanning the Chart: The script identifies every object on your current main window that is classified as a "Trend Line." It creates an inventory of these items so it can apply changes to them in one go.
- Dynamic Adjustments: For every trend line found, the script retrieves its current price and time coordinates. It then applies two specific types of movements:
- Price Shift: It adjusts the vertical position (price) of the lines by a user-defined amount. This is useful if you need to offset multiple lines by a consistent number of pips or points.
- Date/Time Shift: It calculates a time difference between the current date and the line's original start point, moving the lines horizontally across the timeline.
- Automatic Anchor Management: If a trend line is missing specific coordinates (for example, if it hasn't been properly anchored), the script has a built-in "fail-safe." It will automatically snap those points to the current market price and the most recent time candle to ensure the movement logic remains consistent.
- Error Reporting: The script includes a feedback system. If it encounters a specific line that it cannot move due to platform restrictions or technical conflicts, it logs an error code in the background so you can identify which objects may need manual attention.
Key User Benefits
- Batch Processing: Rather than moving 20 lines one by one, you run this script once to shift the entire layout.
- Precision: By using exact "Point" and "Date" shifts, it ensures that the relative spacing between your trend lines remains perfectly preserved after the move.
- Workflow Efficiency: This is specifically designed for traders who perform large-scale structural analysis and need to "re-set" or "offset" their historical data quickly.
10
Views
0
Downloads
0
Favorites
Move_Trand_line
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | M o v e T r a n d l i n e . m q 5 |
/ / | C o p y r i g h t 2 0 1 7 , M e t a Q u o t e s S o f t w a r e C o r p . |
/ / | h t t p s : / / w w w . m q l 5 . c o m |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "