i-IntradayFibonacci

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

The i-IntradayFibonacci indicator is a specialized technical analysis tool designed to help traders visualize key price levels on a daily basis. It automatically calculates and plots specific Fibonacci retracement levels based on the high and low prices of the previous trading day.

How it Works

Instead of requiring the user to manually draw lines on the chart, this script automates the calculation of price zones. The core logic functions as follows:

  • Daily Reference Points: The tool looks back at the previous full day's performance to identify two primary markers: the absolute highest price reached (the High) and the absolute lowest price reached (the Low).
  • Dynamic Calculation: Using these two points, the indicator calculates the total range of the previous day’s movement. It then applies four specific Fibonacci ratios to that range to determine "support" and "resistance" areas.
  • Automatic Plotting: The script continuously updates the chart by drawing four distinct dotted lines corresponding to these ratios: 0.236, 0.382, 0.618, and 0.764.

Key Features for Traders

  • Intraday Visualization: While it uses daily data as its foundation, the tool is designed to be viewed on intraday charts. This allows traders to see where price might react or stall during the current trading session based on yesterday's volatility.
  • Customizable Scope: Users can define how many bars of historical data the indicator should analyze, allowing for a balance between historical context and current chart clarity.
  • Visual Clarity: By using four different colors (Aqua, Lime, Yellow, and Salmon), the tool provides an immediate visual map of potential price turning points, helping traders identify zones where the market may encounter significant friction.
Price Data Components
Series array that contains the highest prices of each bar
10 Views
0 Downloads
0 Favorites
i-IntradayFibonacci
//+------------------------------------------------------------------+
//|                                          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