Author:
Table_v0

This script is a multi-timeframe visual dashboard designed for MetaTrader 4. It serves as a comprehensive "signal table" that allows traders to monitor various technical indicators across nine different timeframes simultaneously on a single chart screen.

Core Functionality

Instead of looking at multiple tabs or windows, this tool creates a structured grid on your chart. It displays five distinct types of market signals based on different technical analysis methodologies:

  1. Moving Average (MA) Cross: Monitors two moving averages. It provides a "Buy" signal when the faster average is above the slower one and a "Sell" signal when it falls below.
  2. Relative Strength Index (RSI): Analyzes momentum by checking the RSI value relative to the 50-level midline and observing the direction of its immediate change.
  3. Commodity Channel Index (CCI): Evaluates price extremes and momentum. It identifies signals based on whether the CCI is above or below specific thresholds (100 and -100) combined with its current trend direction.
  4. Bar Price Action: A simple logic check comparing the current bar's opening price to its closing price to determine immediate price movement.
  5. Gap Analysis: Detects gaps between the current bar's open and the previous bar's close, providing a visual cue of sudden price jumps or shifts.

Visual Organization

The tool is organized into a neat matrix for easy reading:

  • Timeframes: The horizontal axis represents nine different timeframes, ranging from 1-minute (M1) all the way up to monthly (MN1).
  • Indicators: The vertical axis lists the five specific signals described above.
  • Visual Cues: The dashboard uses specialized icons (Wingdings symbols) and color coding:
    • Green/Lime: Indicates a potential "Buy" opportunity.
    • Red: Indicates a potential "Sell" opportunity.
    • Purple: Represents a neutral state or "No Signal."

User Experience

When you load this script, it automatically builds the dashboard in a corner of your chart (customizable by the user). It updates in real-time as price moves, allowing a trader to see at a glance if multiple timeframes are aligning in the same direction—a common technique used to confirm high-probability trades. When the indicator is removed from the chart, it automatically cleans up all visual elements to leave your workspace tidy.

Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each bar
Indicators Used
Moving average indicatorRelative strength indexCommodity channel index
13 Views
0 Downloads
0 Favorites
Table_v0
//////////////////////////////////////////////////////////////////////
//
//                                                  signalTable.mq4  
//
//////////////////////////////////////////////////////////////////////
#property copyright ""
#property link      ""

#property indicator_chart_window

extern string ____1____ = "Íàñòðîéêè äëÿ ìàøåê";
extern int period_MA1        = 5;
extern int ma_method_MA1     = 0;
extern int applied_price_MA1 = 0;
extern int period_MA2        = 12;
extern int ma_method_MA2     = 0;
extern int applied_price_MA2 = 0;

extern string ____2____ = "Íàñòðîéêè RSI";
extern int period_rsi        =21;
extern int applied_price_rsi =0;

extern string ____3____ = "Íàñòðîéêè CCI";
extern int period_CCI        =14;
extern int applied_price_CCI =0;

extern string ____4____ = " Êîäû ñòðåëîê";
extern int symbolCodeBuy=221, 
           symbolCodeSell=222, 
           symbolCodeNoSignal=175;

extern string ____5____ = "Íàñòðîéêè öâåòîâ";
extern color noSignalColor=MediumPurple,
             BayColor = Lime,
             SellColor = Red,
             textColor=Gold;
                        
extern string ___6___ = "Êîîðäèíàòû_íà_ãðàôèêå";            
extern int scaleX=20,
           scaleY=20,
           offsetX=35,
           offsetY=20,
           fontSize=20,
           corner=1;            
            
int period[]={1,5,15,30,60,240,1440,10080,43200};  
string periodString[]={"M1","M5","M15","M30","H1","H4","D1","W1","MN1"},
       // ñîçäàåì åùå îäèí ìàññèâ ñ íàçâàíèÿìè èíäèêàòîðîâ
       signalNameString[]={"2MA","RSI","CCI","Bar","Gep"};

//////////////////////////////////////////////////////////////////////
//
// init()          
//
//////////////////////////////////////////////////////////////////////
int init()
{
   // òàáëèöà ñèãíàëîâ
   for(int x=0;x<9;x++)
      for(int y=0;y<5;y++)
      {
         ObjectCreate("signal"+x+y,OBJ_LABEL,0,0,0,0,0);
         // èçìåíÿåì óãîë ïðèâÿçêè
         ObjectSet("signal"+x+y,OBJPROP_CORNER,corner);
         ObjectSet("signal"+x+y,OBJPROP_XDISTANCE,x*scaleX+offsetX);
         ObjectSet("signal"+x+y,OBJPROP_YDISTANCE,y*scaleY+20);
         ObjectSetText("signal"+x+y,CharToStr(symbolCodeNoSignal),
                       fontSize,"Wingdings",noSignalColor);
      }
  
  // íàçâàíèÿ òàéìôðåéìîâ    
  for(x=0;x<9;x++)
  {
      ObjectCreate("textPeriod"+x,OBJ_LABEL,0,0,0,0,0);   
      // èçìåíÿåì óãîë ïðèâÿçêè      
      ObjectSet("textPeriod"+x,OBJPROP_CORNER,corner);
      ObjectSet("textPeriod"+x,OBJPROP_XDISTANCE,x*scaleX+offsetX);
      ObjectSet("textPeriod"+x,OBJPROP_YDISTANCE,offsetY-10);
      ObjectSetText("textPeriod"+x,periodString[x],8,"Tahoma",textColor);
  }
  
  // íàçâàíèÿ èíäèêàòîðîâ 
  for(y=0;y<5;y++)
  {
      ObjectCreate("textSignal"+y,OBJ_LABEL,0,0,0,0,0);   
      // èçìåíÿåì óãîë ïðèâÿçêè      
      ObjectSet("textSignal"+y,OBJPROP_CORNER,corner);
      ObjectSet("textSignal"+y,OBJPROP_XDISTANCE,offsetX-25);
      ObjectSet("textSignal"+y,OBJPROP_YDISTANCE,y*(scaleY)+offsetY+8);
      ObjectSetText("textSignal"+y,signalNameString[y],8,"Tahoma",textColor);      
  }
  return(0);
}
  
int start()
{
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--MA--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   for(int x=0;x<9;x++)
   {
      double MA1 = iMA(Symbol(),period[x],period_MA1,0,ma_method_MA1,applied_price_MA1,0);
      double MA2 = iMA(Symbol(),period[x],period_MA2,0,ma_method_MA2,applied_price_MA2,0);
      if(MA1>MA2)
        ObjectSetText("signal"+x+"0",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
      // ñèãíàë íà ïðîäàæó   
      else if(MA1<MA2) 
        ObjectSetText("signal"+x+"0",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);   
   }
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--RSI--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   for(x=0;x<9;x++)
   {
      double rsi = iRSI(Symbol(),period[x],period_rsi,applied_price_rsi,0);
      double rsi_1 = iRSI(Symbol(),period[x],period_rsi,applied_price_rsi,1);
      double del = rsi-rsi_1;
      // ñèãíàë 
      if(rsi>50&&del>0)
        ObjectSetText("signal"+x+"1",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
      if(rsi>50&&del<0)
        ObjectSetText("signal"+x+"1",CharToStr(symbolCodeSell),fontSize,"Wingdings",BayColor);        
      // ñèãíàë íà ïðîäàæó   
      else if(rsi<50&&del<0) 
        ObjectSetText("signal"+x+"1",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
      else if(rsi<50&&del>0) 
        ObjectSetText("signal"+x+"1",CharToStr(symbolCodeBuy),fontSize,"Wingdings",SellColor);           
   }
   
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--CCI--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      for(x=0;x<9;x++)
   {
      double CCI =iCCI(Symbol(),period[x],period_CCI,applied_price_CCI,0);
      double CCI_1 =iCCI(Symbol(),period[x],period_CCI,applied_price_CCI,1);
      double der =CCI-CCI_1;
      if(CCI>100&&der>0)
        ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
      if(CCI>100&&der<0)
        ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",BayColor);
        
      if(CCI<100&&CCI>-100&&der>0)
        ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",noSignalColor);
      if(CCI<100&&CCI>-100&&der<0)
        ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",noSignalColor);
        
        
      // ñèãíàë íà ïðîäàæó   
      else if(CCI<-100&&der<0) 
        ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
      else if(CCI<-100&&der>0) 
        ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",SellColor);         
   }
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--Bar--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   for(x=0;x<9;x++)
   {
    double x00 =iOpen(Symbol(),period[x],0)-iClose(Symbol(),period[x],0);
      // ñèãíàë 
      if(x00<0)
        ObjectSetText("signal"+x+"3",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
      // ñèãíàë íà ïðîäàæó   
      else if(x00>0) 
        ObjectSetText("signal"+x+"3",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);   
   } 
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--Gep--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx   
      for(x=0;x<9;x++)
   {
      
    double x0 =iOpen(Symbol(),period[x],0)-iClose(Symbol(),period[x],1);


      // ñèãíàë íà ïîêóïêó   
      if(x0>0)
      ObjectSetText("signal"+x+"4",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);      
      if(x0<0)
      ObjectSetText("signal"+x+"4",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
      if(x0==0)
      ObjectSetText("signal"+x+"4",CharToStr(symbolCodeNoSignal),fontSize,"Wingdings",noSignalColor);            
   }
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
   
     
   return(0);
}

//////////////////////////////////////////////////////////////////////
//
//  deinit()                       
//
//////////////////////////////////////////////////////////////////////
int deinit()
{
   // ïðè óäàëåíèè íàøåãî èíäèêàòîðà íóæíî óäàëèòü âñå îáúåêòû,
   // êîòîðûå ìû óæå ñîçäàëè

   ObjectsDeleteAll();
   return(0);
}

Comments