### Description of the MQL4 Script Logic
This script is designed to draw a Fibonacci Fan on a Metatrader chart, allowing users to customize the Fibonacci levels used in the fan. Here's a breakdown of what the script does in simpler terms:
1. **User Input:** The script starts by asking the user for several pieces of information.
* **Fibonacci Levels:** The user can define specific Fibonacci ratios (like 0.382, 0.618, etc.) that determine the angles of the fan lines. These values are entered as a comma-separated list.
* **Fan Appearance:** The user sets the name, color, style (e.g., solid, dashed), and thickness of the Fibonacci Fan lines.
* **Fan Position:** The user sets two points that define the base of the fan. These points are based on a percentage of the chart's visible date and price ranges.
* **Other options:** The user sets if the drawn lines will be in the background, selectable for moving, visible, etc.
2. **Data Preparation:** The script takes the comma-separated list of Fibonacci levels provided by the user and converts it into a numerical array, allowing the script to easily use these numbers in calculations later.
3. **Coordinate Calculation:**
* It determines the number of bars (candles) currently visible on the chart.
* It finds the highest and lowest price points currently displayed on the chart.
* It takes the date and price percentages entered by the user and converts them into specific date and price values on the chart. This conversion uses the visible bars, the price range, and accuracy values to determine the precise location of the fan's anchor points.
4. **Fibonacci Fan Creation:** Using the calculated date and price coordinates, the script draws the Fibonacci Fan object on the chart. It uses the user-defined name, color, line style, and other visual properties when creating the object.
5. **Level Customization:** The script sets the Fibonacci levels on the newly created Fibonacci Fan object. This involves:
* Setting the number of levels based on the user-provided values.
* Assigning each level its corresponding Fibonacci ratio.
* Setting the color and line style for each level based on user inputs.
6. **Level Descriptions (Optional):**
*It attempts to add descriptions to each level of the Fibonacci Fan. If the user provides enough descriptions it adds them to the levels. If it does not find enough descriptions for each level, it adds the default fibonacci ratio to the description.
7. **Chart Refresh:** Finally, the script tells Metatrader to redraw the chart, ensuring the Fibonacci Fan is visible with all the user's customizations.
In essence, this script automates the process of drawing a customizable Fibonacci Fan on a chart, making it easier for traders to analyze potential support and resistance levels based on Fibonacci ratios.
7
Views
0
Downloads
0
Favorites
Fibonacci_Fan
ÿþ/ / - - - d e s c r i p t i o n
# p r o p e r t y c o p y r i g h t "