Fractals5+Signal+diapazon

Author: � Maloma
Fractals5+Signal+diapazon

The Fractals5+Signal tool is a specialized technical analysis indicator designed to identify specific price patterns on a trading chart. Its primary purpose is to highlight structural turning points in market momentum by identifying "fractal" formations—essentially peak and valley points where the price shifts direction.

How the Logic Works

The script scans historical price data bar-by-bar to detect two distinct types of structural shifts: high-point peaks (resistance) and low-point valleys (support).

1. Identifying High-Point Peaks (Fractals Up) The tool looks for a specific "five-bar" formation where a central high point is greater than the highs of the bars immediately surrounding it. Specifically, if a peak occurs that is higher than its neighbors to both the left and right, the script recognizes this as a structural ceiling. When this condition is met:

  • It marks the historical peak for visual reference.
  • It generates a "Signal" point at the current price level to alert the user to the potential shift.
  • It captures the price range (the "Diapazon") between the opening price and that high peak.

2. Identifying Low-Point Valleys (Fractals Down) Conversely, the script scans for price "floor" formations. It looks for a central low point that is lower than the lows of the bars surrounding it. When this downward pivot is identified:

  • It marks the historical valley for visual reference.
  • It generates a "Signal" point above the current price level to notify the user of the floor formation.
  • It captures the price range (the "Diapazon") between the opening price and that low valley.

Visual Representation on the Chart

The indicator translates these mathematical calculations into clear visual cues on your trading screen:

  • Fractal Markers: These show you exactly where the historical peaks and valleys were formed, helping you see the overall structure of the market.
  • Signal Arrows: These provide immediate visual feedback when a new fractal pattern is confirmed, acting as a prompt for price action changes.
  • Diapazon Ranges: The script tracks the distance between the opening prices and these fractal points, helping users visualize the intensity or magnitude of the price movement within that specific cycle.

In summary, this tool automates the process of spotting significant "pivot" points in price action, allowing a trader to see where the market has historically pushed against resistance or pulled back from support more efficiently than manual observation alone.

Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
Fractals5+Signal+diapazon
//+------------------------------------------------------------------+
//|                                             Fractals5+Signal.mq4 |
//+------------------------------------------------------------------+
#property copyright "© Maloma"

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 OrangeRed
#property indicator_color4 CornflowerBlue
#property indicator_color5 Magenta
#property indicator_color6 Teal
//---- input parameters

//---- buffers
double dUpFractalsBuffer[];
double dDownFractalsBuffer[];
double dUpSignalBuffer[];
double dDownSignalBuffer[];
double UpDiapazonBuffer[];
double DnDiapazonBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator buffers mapping  
    SetIndexBuffer(0,dUpFractalsBuffer);
    SetIndexBuffer(1,dDownFractalsBuffer);   
    SetIndexBuffer(2,dUpSignalBuffer);
    SetIndexBuffer(3,dDownSignalBuffer);   
    SetIndexBuffer(4,UpDiapazonBuffer);
    SetIndexBuffer(5,DnDiapazonBuffer);   
//---- drawing settings
    SetIndexStyle(0,DRAW_ARROW,EMPTY,1);
    SetIndexArrow(0,119);
    SetIndexStyle(1,DRAW_ARROW,EMPTY,1);
    SetIndexArrow(1,119);
    SetIndexStyle(2,DRAW_ARROW,EMPTY,2);
    SetIndexArrow(2,241);
    SetIndexStyle(3,DRAW_ARROW,EMPTY,2);
    SetIndexArrow(3,242);
    SetIndexStyle(4,DRAW_SECTION,EMPTY,2);
    SetIndexStyle(5,DRAW_SECTION,EMPTY,2);
//----
    SetIndexEmptyValue(0,0.0);
    SetIndexEmptyValue(1,0.0);
    SetIndexEmptyValue(2,0.0);
    SetIndexEmptyValue(3,0.0);
    SetIndexEmptyValue(4,0.0);
    SetIndexEmptyValue(5,0.0);
//---- name for DataWindow
    SetIndexLabel(0,"Fractal Up");
    SetIndexLabel(1,"Fractal Down");
    SetIndexLabel(2,"Signal Up");
    SetIndexLabel(3,"Signal Down");
    SetIndexLabel(4,"Diapazon Up");
    SetIndexLabel(5,"Diapazon Down");
//---- initialization done   
    IndicatorShortName("F5S");
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int i,nCountedBars;
    nCountedBars=IndicatorCounted();
//---- check for possible errors
    if(nCountedBars<0 || Bars<5) return(-1);
//----
      i=Bars-nCountedBars-1;
    while(i>=0)
     {
//----Up and Down Fractals
//----5 bars Fractal
          if(High[i+3]>=High[i+4] && High[i+3]>High[i+5] && High[i+3]>High[i+2] && High[i+3]>High[i+1])
            {
             dUpSignalBuffer[i]= Low[i]-3*Point;
             dUpFractalsBuffer[i+3]= High[i+3];
             UpDiapazonBuffer[i]= Open[i];
             UpDiapazonBuffer[i+3]= High[i+3];
            }
          if(Low[i+3]<=Low[i+4] && Low[i+3]<Low[i+5] && Low[i+3]<Low[i+2] && Low[i+3]<Low[i+1])
            {
              dDownSignalBuffer[i]= High[i]+3*Point;
              dDownFractalsBuffer[i+3]= Low[i+3];
              DnDiapazonBuffer[i]= Open[i];
              DnDiapazonBuffer[i+3]= Low[i+3];
            }                      
      i--;
     }

//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments