syminfo
Download scriptThis script is designed as a visual dashboard for traders, providing a quick at-a-glance overview of market trends across multiple currency pairs simultaneously. Instead of requiring you to switch between different charts, it consolidates this data into a single grid on your screen.
Core Functionality
The tool monitors a matrix of 25 different currency combinations (formed by crossing five base currencies with five secondary currencies). For each combination, the script analyzes technical data to determine if the current market trend is bullish (upward), bearish (downward), or neutral.
How the Logic Works
To determine the trend for each pair, the script uses a "Triple Moving Average" logic:
- Data Calculation: The script calculates three different moving averages for every currency pair in its list. These averages are based on specific time frames and price settings defined within the tool.
- Trend Identification: It compares the positions of these three averages relative to one another:
- Bullish Signal: If the fastest average is higher than the middle one, and the middle one is higher than the slowest one, the script identifies an upward trend.
- Bearish Signal: If the fastest average is lower than the middle one, and the middle one is lower than the slowest one, the script identifies a downward trend.
- Neutral Signal: If the averages are overlapping or not clearly stacked in one direction, the script identifies no clear trend.
Visual Presentation
The results are displayed as a clean, organized grid on your trading terminal:
- Icons: The script uses specific visual markers (symbols) to represent the status of each pair.
- Color Coding:
- Gold indicates a Buy/Bullish signal.
- Medium Purple indicates a Sell/Bearish signal.
- White Smoke indicates a neutral state or no clear signal.
- Labels: The dashboard includes text labels so you can easily identify which currency pair corresponds to which icon in the grid.
User Experience
When you load this script, it automatically builds the dashboard layout on your chart. It continuously refreshes the data in real-time, ensuring that the icons change color instantly as market conditions shift. When you remove the script from the chart, it is programmed to clean up after itself, removing all labels and icons to keep your workspace tidy.
//+------------------------------------------------------------------+
//| SymInfo.mq4 ver1.0 by A.Voronin |
//+------------------------------------------------------------------+
#property copyright "2015, A.Voronin"
#property link "giskoats@gmail.com"
#property description "SymbolInfo v1.0"
#property indicator_chart_window
//---
extern string note3="Èíäèêàòîð òðåíäà";
extern int ShiftMA1=9; //19
extern int ShiftMA2 = 26; //55
extern int ShiftMA3 = 55; //89
extern string MAMode= "MODE_EMA";
extern string PriceMode="PRICE_CLOSE";
//---
extern string note5 = "Óãîë îòîáðàæåíèÿ èíäèêàòîðà";
extern string note6 = "Âåðõ ëåâûé=0; Âåðõ ïðàâûé=1";
extern string note7 = "Íèæíèé ëåâûé=2; Íèæíèé ïðàâûé=3";
extern int ThisCorner=0;
double MA1,MA2,MA3;
int scaleX=20,
scaleY=20,
offsetX=35,
offsetY=20,
fontSize=20,
symbolCodeBuy=241,
symbolCodeSell=242,
symbolCodeNoSignal=240;
//---
color signalBuyColor=Gold,
signalSellColor=MediumPurple,
noSignalColor=WhiteSmoke,
textColor=Gold;
//---
string SymbolName[]={"USD","GBP","NZD","AUD","EUR"},
//--- ñîçäàåì åùå îäèí ìàññèâ ñ íàçâàíèÿìè èíäèêàòîðîâ
CrossSymbol[]={"RUB","CHF","CAD","USD","JPY"};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void Info()
{
for(int x=0;x<5;x++)
for(int y=0;y<5;y++)
{
//--- ñèãíàë íà ïîêóïêó
if(SymbolTrend(x,y)>0)
ObjectSetText("symsignal"+x+y,CharToStr(symbolCodeBuy),fontSize,"Wingdings",signalBuyColor);
//--- ñèãíàë íà ïðîäàæó
if(SymbolTrend(x,y)<0)
ObjectSetText("symsignal"+x+y,CharToStr(symbolCodeSell),fontSize,"Wingdings",signalSellColor);
//--- íåò ñèãíàëà
if(SymbolTrend(x,y)==0)
ObjectSetText("symsignal"+x+y,CharToStr(symbolCodeNoSignal),fontSize,"Wingdings",noSignalColor);
}
//---
return;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
for(int x=0;x<5;x++)
for(int y=0;y<5;y++)
{
ObjectCreate("symsignal"+x+y,OBJ_LABEL,0,0,0,0,0);
//--- èçìåíÿåì óãîë ïðèâÿçêè
ObjectSet("symsignal"+x+y,OBJPROP_CORNER,ThisCorner);
ObjectSet("symsignal"+x+y,OBJPROP_XDISTANCE,x*scaleX+offsetX);
ObjectSet("symsignal"+x+y,OBJPROP_YDISTANCE,y*scaleY+20);
ObjectSetText("symsignal"+x+y,CharToStr(symbolCodeNoSignal),
fontSize,"Wingdings",noSignalColor);
}
//--- íàçâàíèÿ òàéìôðåéìîâ
for(x=0;x<5;x++)
{
ObjectCreate("sn"+x,OBJ_LABEL,0,0,0,0,0);
//--- èçìåíÿåì óãîë ïðèâÿçêè
ObjectSet("sn"+x,OBJPROP_CORNER,ThisCorner);
ObjectSet("sn"+x,OBJPROP_XDISTANCE,x*scaleX+offsetX);
ObjectSet("sn"+x,OBJPROP_YDISTANCE,offsetY-10);
ObjectSetText("sn"+x,SymbolName[x],8,"Tahoma",textColor);
}
//--- íàçâàíèÿ èíäèêàòîðîâ
for(y=0;y<5;y++)
{
ObjectCreate("cs"+y,OBJ_LABEL,0,0,0,0,0);
//--- èçìåíÿåì óãîë ïðèâÿçêè
ObjectSet("cs"+y,OBJPROP_CORNER,ThisCorner);
ObjectSet("cs"+y,OBJPROP_XDISTANCE,offsetX-25);
ObjectSet("cs"+y,OBJPROP_YDISTANCE,y*(scaleY)+offsetY+8);
ObjectSetText("cs"+y,CrossSymbol[y],8,"Tahoma",textColor);
}
//---
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void IndClear()
{
for(int x=0;x<5;x++)
for(int y=0;y<5;y++)
{
ObjectDelete("symsignal"+x+y);
}
//--- íàçâàíèÿ òàéìôðåéìîâ
for(x=0;x<5;x++)
{
ObjectDelete("sn"+x);
}
//--- íàçâàíèÿ èíäèêàòîðîâ
for(y=0;y<5;y++)
{
ObjectDelete("cs"+y);
}
return;
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
//---
IndClear();
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int SymbolTrend(int &x,int &y)
{
RefreshRates();
string sym=SymbolName[x]+CrossSymbol[y];
MA1=iMA(sym,0,ShiftMA1,8,MAMode,PriceMode,0);
MA2=iMA(sym,0,ShiftMA2,8,MAMode,PriceMode,0);
MA3=iMA(sym,0,ShiftMA3,8,MAMode,PriceMode,0);
//---
if((MA1>MA2)&&(MA2>MA3)) return(1);
if((MA1<=MA2)&&(MA2>=MA3)) return(0);
if((MA1>=MA2)&&(MA2<=MA3)) return(0);
if((MA1<MA2)&&(MA2<MA3)) return(-1);
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
//---
Info();
//---
return(0);
}
//+------------------------------------------------------------------+
Comments