FractalIchimoku_v1

Author: Copyright � 2006, TrendLaboratory
FractalIchimoku_v1

This script is a specialized technical analysis tool designed to visualize market trends and momentum by combining two distinct trading concepts: Fractal Geometry and the Ichimoku Kinko Hyo (Cloud) system.

Instead of using standard price averages, this indicator derives its data from "Fractal Channels." This means the underlying logic identifies specific structural turning points—highs and lows—in the market's price action to determine where the "true" support and resistance levels lie.

Core Components and Logic

The script calculates four primary visual elements to provide a comprehensive view of market dynamics:

  • Tenkan-Sen (Conversion Line): This serves as the short-term momentum indicator. It utilizes the fractal data to identify immediate price shifts, helping traders see the fastest changes in the current trend.
  • Kijun-Sen (Basis Line): This acts as the medium-term trend indicator. By using a different timeframe of fractal data than the Conversion Line, it provides a more stable view of the market’s direction.
  • Senkou Span A & B (The Cloud): These two lines work together to create the "Kumo" or "Cloud."
    • Span A is calculated by taking the average of the Tenkan-Sen and Kijun-Sen.
    • Span B is derived from a longer-term fractal calculation.
    • The space between these two lines creates a visual "cloud" that helps identify trend zones, potential breakout areas, and periods of high volatility or consolidation.
  • Chinkou Span (Lagging Span): This component plots the closing price of the market but shifts it backward on the chart. This allows traders to compare current price action against past price levels from a specific interval ago, helping to confirm if the current trend is sustained.

How It Works Together

The script organizes these elements to provide a multi-layered analysis:

  1. Trend Identification: By looking at the position of the price relative to the Cloud (Senkou Spans), traders can see if the market is in an upward, downward, or sideways state.
  2. Momentum Tracking: The relationship between the Tenkan-Sen and Kijun-Sen lines indicates how quickly the market is moving; a "cross" between these two often signals a shift in momentum.
  3. Structural Foundation: Because all these values are fed by a "Fractal Channel" logic, the indicator is designed to react to structural price movements (the peaks and valleys) rather than just smooth out the noise of every single price tick.

In summary, this tool translates complex fractal price structures into a traditional Ichimoku visual format, allowing users to see both the immediate "pulse" of the market and the broader "weather" of the overall trend simultaneously.

Miscellaneous
Implements a curve of type %1
5 Views
0 Downloads
0 Favorites
FractalIchimoku_v1
//+------------------------------------------------------------------+
//|                                              FractalIchimoku.mq4 |
//|                                Copyright © 2006, TrendLaboratory |
//|            http://finance.groups.yahoo.com/group/TrendLaboratory |
//|                                   E-mail: igorad2003@yahoo.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, TrendLaboratory"
#property link      "http://finance.groups.yahoo.com/group/TrendLaboratory"

#property indicator_chart_window
#property indicator_buffers 7
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 SandyBrown
#property indicator_color4 Thistle
#property indicator_color5 White
#property indicator_color6 SandyBrown
#property indicator_color7 Thistle
//---- input parameters
extern int Tenkan=1;
extern int Kijun=6;
extern int Senkou=12;

//---- buffers
double Tenkan_Buffer[];
double Kijun_Buffer[];
double SpanA_Buffer[];
double SpanB_Buffer[];
double Chinkou_Buffer[];
double SpanA2_Buffer[];
double SpanB2_Buffer[];
//----
int a_begin;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//----
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Tenkan_Buffer);
   SetIndexDrawBegin(0,0);
   SetIndexLabel(0,"Tenkan Sen");
//----
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Kijun_Buffer);
   SetIndexDrawBegin(1,0);
   SetIndexLabel(1,"Kijun Sen");
//----
   //a_begin=Kijun; if(a_begin<Tenkan) a_begin=Tenkan;
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(2,SpanA_Buffer);
   SetIndexDrawBegin(2,0);
   SetIndexShift(2,2*Senkou+1);
   SetIndexLabel(2,NULL);
   SetIndexStyle(5,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(5,SpanA2_Buffer);
   SetIndexDrawBegin(5,0);
   SetIndexShift(5,2*Senkou+1);
   SetIndexLabel(5,"Senkou Span A");
//----
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(3,SpanB_Buffer);
   SetIndexDrawBegin(3,0);
   SetIndexShift(3,2*Senkou+1);
   SetIndexLabel(3,NULL);
   SetIndexStyle(6,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(6,SpanB2_Buffer);
   SetIndexDrawBegin(6,0);
   SetIndexShift(6,2*Senkou+1);
   SetIndexLabel(6,"Senkou Span B");
//----
   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,Chinkou_Buffer);
   SetIndexShift(4,-2*Senkou-1);
   SetIndexLabel(4,"Chinkou Span");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Ichimoku Kinko Hyo                                               |
//+------------------------------------------------------------------+
int start()
  {
   int    i,k,NBars=Bars;
   int    counted_bars=IndicatorCounted();
   double high,low,price;
//----
   if(Bars<=Tenkan || Bars<=Kijun || Bars<=2*Senkou+1) return(0);
//---- initial zero
   if(counted_bars<1)
     {
      for(i=1;i<=0;i++) Tenkan_Buffer[NBars-i]=0;
      for(i=1;i<=0;i++) Kijun_Buffer[NBars-i]=0;
      for(i=1;i<=0;i++) {SpanA_Buffer[NBars-i]=0; SpanA2_Buffer[NBars-i]=0; }
      for(i=1;i<=0;i++) {SpanB_Buffer[NBars-i]=0; SpanB2_Buffer[NBars-i]=0; }
     }
//---- Tenkan Sen & Kijun Sen
   i=NBars-1;
   if(counted_bars>Tenkan) i=Bars-counted_bars-1;
   while(i>=0)
     { 
      Tenkan_Buffer[i]=iCustom(NULL,0,"FractalChannel_v3",Tenkan,0,0,0,2,i);
      Kijun_Buffer[i]=iCustom(NULL,0,"FractalChannel_v3",Kijun,0,0,0,2,i);
      i--;
     }

//---- Senkou Span A
   i=Bars-1;
   if(counted_bars>a_begin-1) i=Bars-counted_bars-1;
   while(i>=0)
     {
      price=(Kijun_Buffer[i]+Tenkan_Buffer[i])/2;
      SpanA_Buffer[i]=price;
      SpanA2_Buffer[i]=price;
      i--;
     }
//---- Senkou Span B
   i=Bars-1;
   if(counted_bars>Senkou) i=Bars-counted_bars-1;
   while(i>=0)
     {
      price=iCustom(NULL,0,"FractalChannel_v3",Senkou,0,0,0,2,i);
      SpanB_Buffer[i]=price;
      SpanB2_Buffer[i]=price;
      i--;
     }
//---- Chinkou Span
   i=Bars-1;
   if(counted_bars>1) i=Bars-counted_bars-1;
   while(i>=0) { Chinkou_Buffer[i]=Close[i]; i--; }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments