signalTable candle
Download scriptThis script functions as a comprehensive visual dashboard for the MetaTrader trading platform. Its primary purpose is to provide a "snapshot" of market conditions across multiple timeframes simultaneously, allowing a trader to see technical trends at a glance without having to switch between different charts.
Dashboard Overview
The script generates a clean, organized table on your chart screen. This table tracks nine specific timeframes—ranging from the 1-minute and 5-minute charts up to the monthly (MN1) charts. Each timeframe is assigned its own row of visual indicators, providing a multi-layered view of market momentum.
Core Logic and Data Processing
The script analyzes three distinct technical indicators for each of the nine timeframes listed. It processes this data in real-time and updates the dashboard automatically:
- Moving Average Trend: The tool looks at the relationship between current moving averages. If the recent average is higher than the previous one, it indicates a positive upward trend (Buy). If it is lower, it indicates a downward trend (Sell).
- Williams %R Oscillator: This section monitors price relative to its high-low range over a set period. It identifies "overbought" or "oversold" conditions. If the price is sufficiently low (oversold), it highlights a potential buy signal; if it is sufficiently high (overbought), it highlights a sell signal. If the price is in a neutral zone, it displays a "no signal" status.
- Parabolic SAR: This indicator is used to track trend reversals. The script compares the current closing price against the Parabolic SAR value. If the price is above the indicator, it suggests a bullish (Buy) bias; if the price is below, it suggests a bearish (Sell) bias.
Visual Presentation
To make this information easy to digest, the script translates complex mathematical calculations into simple color-coded symbols:
- Blue Symbols: Represent "Buy" signals or bullish trends.
- Red Symbols: Represent "Sell" signals or bearish trends.
- White/Grey Symbols: Represent neutral zones where no specific action is suggested by that indicator.
By combining these three different types of logic (Trend, Momentum, and Reversal) across nine different timeframes, the dashboard gives you a high-level overview of whether the market is currently aligned in one direction or if there is conflicting information between short-term and long-term cycles.
//+------------------------------------------------------------------+
//| signalTable.mq4 |
//| Antonuk Oleg |
//| antonukoleg@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Antonuk Oleg"
#property link "antonukoleg@gmail.com"
//----
#property indicator_chart_window
extern int scaleX=20,
scaleY=20,
offsetX=35,
offsetY=20,
fontSize=20,
corner=2,
symbolCodeBuy=39,
symbolCodeSell=39,
symbolCodeNoSignal=73;
extern color signalBuyColor=Blue,
signalSellColor=Red,
noSignalColor=WhiteSmoke,
textColor=Silver;
int period[]={1,5,15,30,60,240,1440,10080,43200};
string periodString[]={"M1","M5","M15","M30","H1","H4","D1","W1","MN1"},
// ñîçäàåì åùå îäèí ìàññèâ ñ íàçâàíèÿìè èíäèêàòîðîâ
signalNameString[]={"Candle"};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
// òàáëèöà ñèãíàëîâ
for(int x=0;x<9;x++)
for(int y=0;y<1;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<1;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()
{
for(int x=0;x<9;x++)
{
// ñèãíàë íà ïîêóïêó
if(iMA(Symbol(),period[x],1,0,0,0,0)>iMA(Symbol(),period[x],2,0,0,0,0))
ObjectSetText("signal"+x+"0",CharToStr(symbolCodeBuy),fontSize,"Wingdings",signalBuyColor);
// ñèãíàë íà ïðîäàæó
else
ObjectSetText("signal"+x+"0",CharToStr(symbolCodeSell),fontSize,"Wingdings",signalSellColor);
}
for(x=0;x<9;x++)
{
// ñèãíàë íà ïîêóïêó
if(MathAbs(iWPR(Symbol(),period[x],13,0))<20.0)
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeBuy),fontSize,"Wingdings",signalBuyColor);
// ñèãíàë íà ïðîäàæó
else if(MathAbs(iWPR(Symbol(),period[x],13,0))>80.0)
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeSell),fontSize,"Wingdings",signalSellColor);
// íåò ñèãíàëà
else
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeNoSignal),fontSize,"Wingdings",noSignalColor);
}
for(x=0;x<9;x++)
{
// ñèãíàë íà ïîêóïêó
if(iSAR(Symbol(),period[x],0.02,0.2,0)<Close[0])
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",signalBuyColor);
// ñèãíàë íà ïðîäàæó
else
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",signalSellColor);
}
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int deinit()
{
// ïðè óäàëåíèè íàøåãî èíäèêàòîðà íóæíî óäàëèòü âñå îáúåêòû,
// êîòîðûå ìû óæå ñîçäàëè
ObjectsDeleteAll();
return(0);
}
//+------------------------------------------------------------------+
Comments