iCCI_M1+H1+D1

Download script
Author: Yuriy Tokman
iCCI_M1+H1+D1

This custom trading indicator is designed to provide a multi-dimensional view of market momentum by combining data from three distinct timeframes simultaneously. Instead of relying on just the current chart's timeframe, it captures a "big picture" perspective by looking at short-term, medium-term, and long-term trends at once.

How the Logic Works

The tool operates by calculating a specific technical metric known as the Commodity Channel Index (CCI) across three different market scales:

  1. 1-Minute Chart (Short-Term): Captures immediate, high-frequency price fluctuations and rapid movements.
  2. 1-Hour Chart (Medium-Term): Provides context on the current day's trend and hourly price direction.
  3. Daily Chart (Long-Term): Shows the overarching direction of the market over several days.

Visual Representation

The indicator tracks these three different scales and displays them as three separate lines in a dedicated window below your main price chart. Each timeframe is assigned a unique color:

  • Red: Represents the 1-Minute data.
  • Green: Represents the 1-Hour data.
  • Blue: Represents the Daily data.

Key Features and Performance

  • Synchronized Analysis: By looking at all three timeframes simultaneously, the indicator allows you to see if short-term momentum is moving in harmony with long-term trends or if it is diverging.
  • Customizable Lookback: Users can adjust how many historical bars are processed and the sensitivity period of the calculation to fit their specific trading style.
  • Efficiency: The script is optimized to only process a set amount of recent data (as defined by the user), ensuring that the platform remains responsive while providing necessary trend information.

In essence, this tool acts as a "trend compass," helping traders identify whether the current immediate price action aligns with the broader market direction across multiple layers of time.

Indicators Used
Commodity channel index
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
iCCI_M1+H1+D1
//+------------------------------------------------------------------+
//|                                                iCCI_M1+H1+D1.mq4 |
//|                                                     Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Blue
//---- input parameters
extern int       barsToProcess=30;
extern int       period=14;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
	SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
	SetIndexBuffer(2,ExtMapBuffer3); SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted(),
//----
 limit;

   if(counted_bars>0)
      counted_bars--;
   
   limit=Bars-counted_bars;
   
   if(limit>barsToProcess)
      limit=barsToProcess;
  
   for(int i=0;i<limit;i++)
   {
      ExtMapBuffer1[i]=iCCI(NULL,PERIOD_M1,period,PRICE_OPEN,i);
      ExtMapBuffer2[i]=iCCI(NULL,PERIOD_H1,period,PRICE_OPEN,i);
      ExtMapBuffer3[i]=iCCI(NULL,PERIOD_D1,period,PRICE_OPEN,i);
   }  
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments