lastweekfibo
Download scriptThis script is designed for traders who use Fibonacci retracement levels to identify potential price turning points. Specifically, it automates the process of identifying and drawing the trading range for the previous week on your chart, providing a visual reference for "Highs" and "Lows" based on historical weekly data.
Here is a breakdown of how the logic works:
Timeframe & Compatibility
The script includes built-in checks to ensure it only runs on specific timeframes. It is designed to work on intraday charts (like the 1-hour) up to daily charts. If you try to run it on a weekly or monthly chart, the script will notify you that it cannot execute because the timeframe is too large.
Market Logic & Time Detection
The tool recognizes that different regions have different "trading weeks." It allows for two modes:
- East: Designed for markets where the week starts on Saturday and ends on Friday.
- West: Designed for markets where the week typically starts on Sunday/Monday and ends on Thursday/Friday.
It automatically calculates the exact start and end dates of the "Last Week" based on the current date and the user's chosen starting day.
Automatic Price Identification
Once the script identifies the correct time window for the previous week, it performs two primary actions:
- High & Low Detection: It scans all price action within that specific one-week window to find the absolute highest price point and the absolute lowest price point reached.
- Visual Mapping: It draws horizontal lines on your current chart to mark these boundaries clearly.
Fibonacci Integration
The core feature of this script is the automatic generation of Fibonacci levels based on that previous week's range:
- Dynamic Drawing: It draws a complete Fibonacci retracement from the weekly high to the weekly low (or vice versa, depending on which occurred first).
- Key Levels: It populates the chart with standard "Golden Section" levels, such as 61.8%, 50.0%, and 38.2%.
- Extended Range: Unlike standard Fibonacci tools that might only show a small section, this one is configured to display an extensive range of levels (from -100% to +200%), giving you a comprehensive view of potential overextended price zones.
Visual Features
- Time Range Lines: Vertical lines are placed to show exactly when the previous week started and ended.
- Price Value Markers: Small arrows/marks are placed at the exact points where the weekly High and Low occurred, so you can see the specific candles that formed those peaks.
- Custom Styling: The script includes a suite of visual controls, allowing you to customize the colors of the price ranges, time boundaries, and Fibonacci levels to match your personal chart aesthetics.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | L a s t W e e k F i b o . m q 4 |
/ / | C o p y r i g h t 2 0 1 5 , 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 "