i-IntradayFibonacci_v1

Download script
Author: ��� ����� �. aka KimIV
i-IntradayFibonacci_v1

This tool is designed to provide traders with a visual map of key price levels based on the Fibonacci retracement principle, specifically tailored for intraday analysis. Rather than manually drawing lines, this script automates the calculation of important psychological price zones by referencing daily market extremes.

How the Logic Works

The core functionality of this indicator relies on identifying the "High" and "Low" points of the previous trading day. Once these boundaries are established, the tool calculates specific percentage-based retracement levels for every price point in the current session.

1. Data Identification The script looks back at the most recent completed daily candle to find its highest peak and its lowest trough. These two values serve as the foundation for all subsequent calculations.

2. Dynamic Calculation Instead of staying static, the indicator constantly recalculates these levels across your current chart. It measures the distance between yesterday’s high and low and then applies four specific Fibonacci ratios to that distance:

  • 23.6%
  • 38.2%
  • 61.8%
  • 76.4%

3. Visual Representation The script projects these four levels as dotted lines on your chart. Because the logic is tied to the daily range, these lines provide a consistent "grid" that helps traders see where the price might stall or reverse during the day.

Key Features for Traders

  • Automated Updates: You do not need to manually click on highs or lows; the script automatically updates the levels as soon as a new trading day begins.
  • Intraday Context: By using daily data to inform intraday movements, it helps traders identify "support" and "resistance" zones where the market has historically shown interest.
  • Customizable Lookback: The tool allows you to define how much historical data the platform should process, ensuring the chart remains clean and responsive.

In summary, this indicator acts as an automated guide that highlights the most mathematically significant price areas within a day's range, allowing for more objective entry and exit planning.

Price Data Components
Series array that contains the highest prices of each bar
11 Views
0 Downloads
0 Favorites
i-IntradayFibonacci_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                          i-IntradayFibonacci.mq4 |
//|                                           Êèì Èãîðü Â. aka KimIV |
//|                                              http://www.kimiv.ru |
//|                                                                  |
//| 14.10.2005  Âíóòðèäíåâíûå óðîâíè Ôèáîíà÷÷è                       |
//+------------------------------------------------------------------+
#property copyright "Êèì Èãîðü Â. aka KimIV"
#property link      "http://www.kimiv.ru"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Lime
#property indicator_color3 Yellow
#property indicator_color4 Salmon

//------- Ãëîáàëüíûå ïåðåìåííûå --------------------------------------

//------- Ïîêëþ÷åíèå âíåøíèõ ìîäóëåé ---------------------------------

//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern int NumberOfBars = 1000;  // Êîëè÷åñòâî áàðîâ îáñ÷¸òà (0-âñå)

//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double buf24[];
double buf38[];
double buf62[];
double buf76[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init() {
  SetIndexBuffer(0, buf24);
  SetIndexStyle (0, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(0, EMPTY_VALUE);

  SetIndexBuffer(1, buf38);
  SetIndexStyle (1, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(1, EMPTY_VALUE);

  SetIndexBuffer(2, buf62);
  SetIndexStyle (2, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(2, EMPTY_VALUE);

  SetIndexBuffer(3, buf76);
  SetIndexStyle (3, DRAW_LINE, STYLE_DOT);
  SetIndexEmptyValue(3, EMPTY_VALUE);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start() {
  double dMax, dMin;
  int    loopbegin, nsb, prevDay, shift;

 	if (NumberOfBars==0) loopbegin = Bars - 1;
  else loopbegin = NumberOfBars - 1;

  for (shift=loopbegin; shift>=0; shift--) {
    if (prevDay!=TimeDay(Time[shift])) {
      nsb=iBarShift(NULL, PERIOD_D1, Time[shift]);
      dMax=iHigh(NULL, PERIOD_D1, nsb);
      dMin=iLow (NULL, PERIOD_D1, nsb);
    }
    buf24[shift]=dMin-(dMin-dMax)*0.236;
    buf38[shift]=dMin-(dMin-dMax)*0.382;
    buf62[shift]=dMin-(dMin-dMax)*0.618;
    buf76[shift]=dMin-(dMin-dMax)*0.764;
    prevDay=TimeDay(Time[shift]);
  }
}
//+------------------------------------------------------------------+

Comments