FXRaiderTable_enM

Author: Copyright � 2008, AlexKS
FXRaiderTable_enM

This script functions as a comprehensive multi-currency dashboard designed to provide traders with an at-a-glance summary of market sentiment across various currency pairs and timeframes. Instead of requiring you to monitor multiple charts manually, it aggregates complex technical data into a single, organized table.

Core Logic and Functionality

Multi-Asset Monitoring The script simultaneously tracks seven major currency pairs (including EURUSD, GBPUSD, USDJPY, etc.). For each pair, it evaluates market conditions across six distinct time horizons: Weekly, Daily, and four specific 4-hour intervals throughout the day.

Data Collection (The "Calc" Phase) For every currency pair and timeframe mentioned above, the script retrieves three different types of technical indicators:

  • Moving Averages (MA): These measure the general trend of price movement. The script compares different moving average types to see if the price momentum is shifting.
  • MACD (Moving Average Convergence Divergence): This helps identify changes in the strength, direction, and speed of price movements.
  • Parabolic SAR: A specific tool used to identify potential reversal points in a trend.

Analysis and Scoring (The "Analis" Phase) This is the "brain" of the script. It looks at the raw data gathered in the previous step and converts it into a simplified scoring system:

  • It compares the current values of the indicators against their historical counterparts.
  • If the indicators align to suggest an upward trend, they receive a positive score.
  • If they align toward a downward trend, they receive a negative score.
  • The script then calculates a "Total Score" for every timeframe. This score determines the strength of the sentiment: a high positive score indicates a very strong buy signal, while a high negative score indicates a strong sell signal.

Visual Dashboard (The "CreateObjects" Phase) Finally, the script translates these mathematical scores into a user-friendly visual table on your screen. Rather than showing you raw numbers or complicated lines, it uses a shorthand system of labels:

  • UP!! – Indicates high agreement across multiple indicators for a bullish move.
  • UP! / UP – Indicates moderate to single indicator confirmation for an upward move.
  • DOWN / DOWN! / DOWN!! – Indicates varying degrees of bearish sentiment.
  • Neutral Colors: When there is no clear trend (a score of zero), the script displays a neutral gray marker.

Summary for the User

Essentially, this tool acts as a "weather report" for the forex market. It scans all your preferred currencies, checks multiple technical "sensors" across different timeframes, and paints a clear picture of where the momentum is heading, allowing you to make faster, more informed decisions without switching between dozens of individual charts.

Price Data Components
Series array that contains open time of each barSeries array that contains the highest prices of each bar
Indicators Used
MACD HistogramMoving average indicator
12 Views
0 Downloads
0 Favorites
FXRaiderTable_enM
//+------------------------------------------------------------------+
//|                                                FXRaiderTable.mq4 |
//|                                         Copyright © 2008, AlexKS |
//|                                                                  |
//+------------------------------------------------------------------+
//mod: FXRaiderTable_enM.mq4
//org: http://codebase.mql4.com/ru/4790

#property copyright "Copyright © 2008, AlexKS"
#property link      "alex_ks@bk.ru"
#property indicator_separate_window

double BUFFER[100][100];
double VALUES[100][100];
int    TOTAL[100][100];

//ÑÏÈÑÎÊ ÈÍÑÒÐÓÌÅÍÒÎÂ (ÏÐÎÑÒÎ ÄÎÁÀÂÈÒÜ â ÑÏÈÑÎÊ)
string SYMBOLS[] = {"EURUSD","GBPUSD","AUDUSD","NZDUSD","USDCHF","USDJPY","USDCAD"}; 

string FRAMES[]  = {"W","D","H4(9:00)","H4(13:00)","H4(17:00)","H4(21:00)"}; 
string ARROWS[9]; 


string short_name = "FXRaiderTable EM";

int init() 
{    
   return(0); 
}
int deinit() { return(0); }
  
int start()
  {   
      ARROWS[0] = "DOWN!!";  
      ARROWS[1] = "DOWN!";
      ARROWS[2] = "DOWN";
      ARROWS[3] = "DOWN";
      ARROWS[4] = "-";
      ARROWS[5] = "UP";
      ARROWS[6] = "UP";
      ARROWS[7] = "UP!";
      ARROWS[8] = "UP!!";  
      IndicatorShortName(short_name);
      //Ðàñ÷åò èíäèêàòîðîâ
      Calc();
      //Àíàëèç ðåçóëüòàòîâ
      Analis();
      //Ñîçäàíèå îáúåêòîâ      
      CreateObjects();                      
      return(0);
  }

void Calc()
{    
    ArrayInitialize(BUFFER,-1);    
    for(int i=0; i<ArrayRange(SYMBOLS,0); i++)      
    {      
      string symbol = SYMBOLS[i];
      BUFFER[i][0]  = iMA    (symbol, PERIOD_W1, 55, 0, 3, PRICE_CLOSE, 0);
      BUFFER[i][1]  = iMA    (symbol, PERIOD_W1, 21, 0, 3, PRICE_CLOSE, 0);
      BUFFER[i][2]  = iMACD(symbol,PERIOD_W1,8,13,1,PRICE_OPEN,MODE_MAIN,0);
      BUFFER[i][3]  = iMACD(symbol,PERIOD_W1,8,13,1,PRICE_OPEN,MODE_MAIN,1);
//      BUFFER[i][2]  = iCustom(symbol, PERIOD_W1, "Awesome", 0, 0);
//      BUFFER[i][3]  = iCustom(symbol, PERIOD_W1, "Awesome", 0, 1);
      BUFFER[i][4]  = iMA(symbol,PERIOD_D1,34,0,MODE_LWMA,PRICE_OPEN,0);
      BUFFER[i][5]  = iMA(symbol,PERIOD_D1,35,2,MODE_LWMA,PRICE_OPEN,0);
//      BUFFER[i][4]  = iCustom(symbol, PERIOD_D1, "t_ma", 0, 0);
//      BUFFER[i][5]  = iCustom(symbol, PERIOD_D1, "t_ma", 1, 0);
      BUFFER[i][6]  = iMACD(symbol,PERIOD_D1,8,13,1,PRICE_OPEN,MODE_MAIN,0);
      BUFFER[i][7]  = iMACD(symbol,PERIOD_D1,8,13,1,PRICE_OPEN,MODE_MAIN,1);
//      BUFFER[i][6]  = iCustom(symbol, PERIOD_D1, "Awesome", 0, 0);
//      BUFFER[i][7]  = iCustom(symbol, PERIOD_D1, "Awesome", 0, 1);
      BUFFER[i][8]  = iSAR   (symbol, PERIOD_D1, 0.02, 0.2, 0); 
      
      int shift1, shift2, shift3, shift4;
      if (TimeHour( iTime(symbol, PERIOD_H4, 0) ) == 0)  { shift1=-1; shift2=-1; shift3=-1; shift4=-1; }
      if (TimeHour( iTime(symbol, PERIOD_H4, 0) ) == 4)  { shift1= 0; shift2=-1; shift3=-1; shift4=-1; }
      if (TimeHour( iTime(symbol, PERIOD_H4, 0) ) == 8)  { shift1= 1; shift2= 0; shift3=-1; shift4=-1; }
      if (TimeHour( iTime(symbol, PERIOD_H4, 0) ) == 12) { shift1= 2; shift2= 1; shift3= 0; shift4=-1; }
      if (TimeHour( iTime(symbol, PERIOD_H4, 0) ) == 16) { shift1= 3; shift2= 2; shift3= 1; shift4= 0; }      
      if (TimeHour( iTime(symbol, PERIOD_H4, 0) ) == 20) { shift1= 4; shift2= 3; shift3= 2; shift4= 1; }            
  
      if (shift1 > 0)
      {         
      BUFFER[i][9]   = iMA(symbol,PERIOD_H4,34,0,MODE_LWMA,PRICE_OPEN,shift1);
      BUFFER[i][10]  = iMA(symbol,PERIOD_H4,35,2,MODE_LWMA,PRICE_OPEN,shift1);
//         BUFFER[i][9]  = iCustom(symbol, PERIOD_H4, "t_ma", 0, shift1);
//         BUFFER[i][10] = iCustom(symbol, PERIOD_H4, "t_ma", 1, shift1);
      BUFFER[i][11]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift1);
      BUFFER[i][12]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift1);
//         BUFFER[i][11] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift1);
//         BUFFER[i][12] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift1);       
      }      
      if (shift2 > 0)
      {         
 
      BUFFER[i][13]  = iMA(symbol,PERIOD_H4,34,0,MODE_LWMA,PRICE_OPEN,shift2);
      BUFFER[i][14]  = iMA(symbol,PERIOD_H4,35,2,MODE_LWMA,PRICE_OPEN,shift2);
      BUFFER[i][15]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift2);
      BUFFER[i][16]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift2);
 
//         BUFFER[i][13] = iCustom(symbol, PERIOD_H4, "t_ma", 0, shift2);
//         BUFFER[i][14] = iCustom(symbol, PERIOD_H4, "t_ma", 1, shift2);
//         BUFFER[i][15] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift2);
//         BUFFER[i][16] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift2);       
      }
      if (shift3 > 0)
      {

      BUFFER[i][17]  = iMA(symbol,PERIOD_H4,34,0,MODE_LWMA,PRICE_OPEN,shift3);
      BUFFER[i][18]  = iMA(symbol,PERIOD_H4,35,2,MODE_LWMA,PRICE_OPEN,shift3);
      BUFFER[i][19]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift3);
      BUFFER[i][20]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift3);


//         BUFFER[i][17] = iCustom(symbol, PERIOD_H4, "t_ma", 0, shift3);
//         BUFFER[i][18] = iCustom(symbol, PERIOD_H4, "t_ma", 1, shift3);
//         BUFFER[i][19] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift3);
//         BUFFER[i][20] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift3);       
      }
      if (shift4 > 0)
      {

      BUFFER[i][21]  = iMA(symbol,PERIOD_H4,34,0,MODE_LWMA,PRICE_OPEN,shift4);
      BUFFER[i][22]  = iMA(symbol,PERIOD_H4,35,2,MODE_LWMA,PRICE_OPEN,shift4);
      BUFFER[i][23]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift4);
      BUFFER[i][24]  = iMACD(symbol,PERIOD_H4,8,13,1,PRICE_OPEN,MODE_MAIN,shift4);

//         BUFFER[i][21] = iCustom(symbol, PERIOD_H4, "t_ma", 0, shift4);
//         BUFFER[i][22] = iCustom(symbol, PERIOD_H4, "t_ma", 1, shift4);
//         BUFFER[i][23] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift4);
//         BUFFER[i][24] = iCustom(symbol, PERIOD_H4, "Awesome", 0, shift4);       
      }
     }      
}

void Analis()
{
    ArrayInitialize(VALUES,0);    
    for(int i=0; i<ArrayRange(SYMBOLS,0); i++)      
    {      
      string symbol = SYMBOLS[i];
      //Àíàëèç ÌÀ WEEK
      if (BUFFER[i][0]<BUFFER[i][1])  VALUES[i][0] = 2;
      if (BUFFER[i][0]>BUFFER[i][1])  VALUES[i][0] = -2;
      //Àíàëèç Awesome WEEK
      if (BUFFER[i][2]>BUFFER[i][3]) VALUES[i][1]  = 1;
      if (BUFFER[i][2]<BUFFER[i][3]) VALUES[i][1]  = -1;      
      TOTAL[i][0]  = VALUES[i][0]+VALUES[i][1];
      //Àíàëèç T_MA DAY
      if (BUFFER[i][4]>BUFFER[i][5]) VALUES[i][2] = 2;
      if (BUFFER[i][4]<BUFFER[i][5]) VALUES[i][2] = -2;
      //Àíàëèç Awesome DAY
      if (BUFFER[i][6]>BUFFER[i][7]) VALUES[i][3] = 1;
      if (BUFFER[i][6]<BUFFER[i][7]) VALUES[i][3] = -1;      
      //Àíàëèç PSAR DAY
      if (BUFFER[i][8]<iHigh(SYMBOLS[i], PERIOD_D1, 0)) VALUES[i][4] = 1; else VALUES[i][4] = -1;      
      TOTAL[i][1] = VALUES[i][2]+VALUES[i][4];
      if (VALUES[i][2] == 2 || VALUES[i][3] == 1)   TOTAL[i][1] = TOTAL[i][1]+VALUES[i][3];     
      if (VALUES[i][2] == -2 || VALUES[i][3] == -1) TOTAL[i][1] = TOTAL[i][1]+VALUES[i][3];     
      //Àíàëèç T_MA H4 9:00
      if (BUFFER[i][9]>BUFFER[i][10]) VALUES[i][5] = 2;
      if (BUFFER[i][9]<BUFFER[i][10]) VALUES[i][5] = -2;      
      //Àíàëèç Awesome H4 9:00
      if (BUFFER[i][11]>BUFFER[i][12]) VALUES[i][6] = 1;
      if (BUFFER[i][11]<BUFFER[i][12]) VALUES[i][6] = -1;
      TOTAL[i][2]  = VALUES[i][5]+VALUES[i][6];      
      //Àíàëèç T_MA H4 13:00
      if (BUFFER[i][13]>BUFFER[i][14]) VALUES[i][7] = 2;
      if (BUFFER[i][13]<BUFFER[i][14]) VALUES[i][7] = -2;      
      //Àíàëèç Awesome H4 13:00
      if (BUFFER[i][15]>BUFFER[i][16]) VALUES[i][8] = 1;
      if (BUFFER[i][15]<BUFFER[i][16]) VALUES[i][8] = -1;
      TOTAL[i][3]  = VALUES[i][7]+VALUES[i][8];      
      //Àíàëèç T_MA H4 17:00
      if (BUFFER[i][17]>BUFFER[i][18]) VALUES[i][9] = 2;
      if (BUFFER[i][17]<BUFFER[i][18]) VALUES[i][9] = -2;      
      //Àíàëèç Awesome H4 17:00
      if (BUFFER[i][19]>BUFFER[i][20]) VALUES[i][10] = 1;
      if (BUFFER[i][19]<BUFFER[i][20]) VALUES[i][10] = -1;
      TOTAL[i][4]  = VALUES[i][9]+VALUES[i][10];            
      //Àíàëèç T_MA H4 21:00
      if (BUFFER[i][21]>BUFFER[i][22]) VALUES[i][11] = 2;
      if (BUFFER[i][21]<BUFFER[i][22]) VALUES[i][11] = -2;      
      //Àíàëèç Awesome H4 121:00
      if (BUFFER[i][23]>BUFFER[i][24]) VALUES[i][12] = 1;
      if (BUFFER[i][23]<BUFFER[i][24]) VALUES[i][12] = -1;
      TOTAL[i][5]  = VALUES[i][11]+VALUES[i][12];             
     }   
}

void CreateObjects()
{
   int delta_y = 20;
   int delta_x = 60;
   int start_pos_x = 70;
   int start_pos_y = 30;
      
   ObjectCreate("Info", OBJ_LABEL, WindowFind(short_name), 0, 0);
// ObjectSetText("Info", "{UP} - Ñîâïàäåíèå òðåõ èíäèêàòîðîâ; [UP] - äâóõ; UP - îäíîãî",8,"Verdana", MediumVioletRed);
   ObjectSetText("Info", " UP!! - agreement of three indicators; UP! - two;  UP - one ",8,"Verdana", MediumVioletRed);

   ObjectSet("Info", OBJPROP_XDISTANCE, 0);  
   ObjectSet("Info", OBJPROP_YDISTANCE, 15);  
         
   for(int i=0; i< ArrayRange(SYMBOLS,0); i++)
   {      
      ObjectCreate("Title" + SYMBOLS[i], OBJ_LABEL, WindowFind(short_name), 0, 0);
      ObjectSetText("Title" + SYMBOLS[i], SYMBOLS[i],8,"Verdana", Blue);
      ObjectSet("Title" + SYMBOLS[i], OBJPROP_XDISTANCE, (i)*delta_x+start_pos_x);  
      ObjectSet("Title" + SYMBOLS[i], OBJPROP_YDISTANCE, start_pos_y);      
      for(int j=0;j<6;j++)
      {
         ObjectCreate("Title" + FRAMES[j], OBJ_LABEL, WindowFind(short_name), 0, 0);
         ObjectSetText("Title" + FRAMES[j], FRAMES[j],8,"Verdana", Blue);
         ObjectSet("Title" + FRAMES[j], OBJPROP_XDISTANCE, 5);  
         ObjectSet("Title" + FRAMES[j], OBJPROP_YDISTANCE, (j)*delta_y+start_pos_y+30);        
         
         if (TOTAL[i][j]>0)
         {
            ObjectCreate("V"+i+j, OBJ_LABEL, WindowFind(short_name), 0, 0);
            ObjectSetText("V"+i+j, ARROWS[(TOTAL[i][j])+4],8,"Verdana", Lime);
            ObjectSet("V"+i+j, OBJPROP_XDISTANCE, (i)*delta_x+start_pos_x);  
            ObjectSet("V"+i+j, OBJPROP_YDISTANCE, (j)*delta_y+start_pos_y+30);        
         }
         if (TOTAL[i][j]<0)
         {
            ObjectCreate("V"+i+j, OBJ_LABEL, WindowFind(short_name), 0, 0);
            ObjectSetText("V"+i+j, ARROWS[(TOTAL[i][j])+4],8,"Verdana", Red);
            ObjectSet("V"+i+j, OBJPROP_XDISTANCE, (i)*delta_x+start_pos_x);  
            ObjectSet("V"+i+j, OBJPROP_YDISTANCE, (j)*delta_y+start_pos_y+30);        
         }        
         if (TOTAL[i][j]==0)
         {
            ObjectCreate("V"+i+j, OBJ_LABEL, WindowFind(short_name), 0, 0);
            ObjectSetText("V"+i+j, ARROWS[(TOTAL[i][j])+4],8,"Verdana", DarkSlateGray);
            ObjectSet("V"+i+j, OBJPROP_XDISTANCE, (i)*delta_x+start_pos_x);  
            ObjectSet("V"+i+j, OBJPROP_YDISTANCE, (j)*delta_y+start_pos_y+30);        
         }    
         
      }
   }  
}

Comments