yesterdayfibo
Download scriptOverview of the YesterdayFibo Script
This script is designed for use on MetaTrader platforms to visually assist traders by automatically plotting key price levels and Fibonacci retracement data based on the previous day's market activity. Instead of manual calculation, it identifies the extremes of yesterday's trading session and projects them onto your current chart.
Core Functionality
1. Automated Time Recognition The script intelligently determines the boundaries of "Yesterday" based on specific regional requirements. It distinguishes between "East" and "West" markets to ensure the correct timeframes are captured:
- East Market: Generally targets a range from Saturday (00:00) through Friday (23:59).
- West Market: Typically focuses on a range from Friday (00:00) through Thursday (23:59).
The logic includes specific checks to handle weekend gaps, ensuring that the "start" and "end" of the previous trading session are accurately identified regardless of which day of the week you are currently viewing.
2. Dynamic Range Detection Once the script identifies the correct start and end times for yesterday, it scans the price history within that window to find two critical data points:
- Highest Price: The absolute peak reached during the previous session.
- Lowest Price: The absolute bottom reached during the previous session.
3. Visual Chart Mapping The script then translates this data into several visual elements on your chart:
- Time Range Lines: Vertical lines that clearly mark exactly when yesterday's trading period began and ended.
- Price Range Lines: Horizontal lines that highlight the high and low price boundaries of the previous day.
- Price Markers: Visual arrows or marks placed at the exact points where the high and low prices occurred, helping you identify the specific candles where those extremes were hit.
4. Fibonacci Retracement Analysis A key feature of this tool is the automatic generation of a complete Fibonacci retracement suite based on yesterday's range.
- The script automatically calculates various "Golden Section" levels (such as 38.2%, 50.0%, 61.8%, and 76.4%).
- It intelligently determines the direction of the Fibonacci curve; if yesterday’s high occurred after the low, it adjusts the orientation automatically to ensure the levels remain mathematically accurate relative to the price action.
Technical Behavior & Compatibility
- Timeframe Awareness: The script includes a safety check to ensure it only runs on specific intraday timeframes (configurable via settings). It is designed to function on charts smaller than a Daily (D1) candle, such as 15-minute or Hourly charts.
- Clean Up: To maintain a clean workspace, the script includes an "unloading" routine. When you remove the indicator from your chart, it automatically deletes all the lines and arrows it created, preventing clutter.
- Customization: Users can customize the colors of the time ranges, price ranges, and Fibonacci levels through the input settings to match their personal trading aesthetic.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | Y e s t e r d a y 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 "