XIT_FIBS_mod_1
Download scriptThis script is designed to automate the drawing of Fibonacci retracement levels on a trading chart. For traders who use Fibonacci tools to identify potential support and resistance zones, this tool removes the manual work of identifying price extremes and placing the lines yourself.
Core Logic Overview
The script functions by constantly monitoring the visible area of your current trading chart to identify key price points. Here is the step-by-step logic it follows:
1. Automatic Price Detection Instead of waiting for a user to click on a high or low point, the script automatically scans the currently visible bars on your screen. It identifies two critical coordinates:
- The absolute highest price reached within the visible window.
- The absolute lowest price reached within the visible window.
2. Dynamic Orientation The script is intelligent enough to recognize the direction of the market trend based on those two points.
- If the highest point occurred before the lowest point (an uptrend move), it maps the Fibonacci levels accordingly.
- If the lowest point occurred before the highest point (a downtrend move), it flips the orientation to ensure the retracement levels align correctly with the price action.
3. Visual Customization The script allows for specific visual preferences without affecting the underlying logic:
- Color: You can set a custom color for the Fibonacci lines.
- Style: You can choose the line style (e.g., solid, dashed, or dotted).
- Width: You can adjust how thick the lines appear on your screen.
4. Standard Level Mapping Once the high and low points are identified and the orientation is set, the script automatically draws six standard Fibonacci levels:
- 0.0%
- 23.6%
- 38.2%
- 50.0%
- 61.8%
- 100.0%
User Experience
When you load this script, the Fibonacci retracement tool will appear automatically on your chart. Because it uses the "visible window" logic, the lines will refresh and update dynamically as you scroll across different parts of the history or as new price candles form. This ensures that the levels are always relevant to the specific section of the market you are currently analyzing.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | X I T _ F I B S _ m o d _ 1 . m q 4 |
/ / | 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 |
/ / | |
/ / | F i l e 4 5 : A d d e d J a n 2 0 1 7 |
/ / | i n p u t c o l o r L C = D o d g e r B l u e ; / / F i b L i n e C o l o r |
/ / | i n p u t E N U M _ L I N E _ S T Y L E L S = 2 ; / / F i b L i n e S t y l e |
/ / | i n p u t i n t L W = 1 ; / / F i b L i n e W i d t h |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | X I T _ F I B S . m q 4 |
/ / | C o p y r i g h t © 2 0 1 1 , J e f f W e s t - F o r e x - X I T |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "