#Signal_Bars_info
Download scriptThis tool is designed as an on-screen information dashboard for MetaTrader users who need to monitor key market statistics at a glance without cluttering their main trading chart. Instead of appearing as complex lines or shapes, it creates a clean, customizable text display in the corner of your screen.
Core Functionality
The script automatically calculates and displays four primary pieces of live data:
- Market Spread: It tracks the real-time difference between the "Ask" and "Bid" prices, showing you the immediate cost of entering a trade.
- Pips to Open: This calculates the distance from the current market price back to the opening price of the daily candle. It is color-coded to provide a quick visual cue: Green indicates the price is currently higher than the open (bullish movement), while Red indicates it is lower (bearish movement).
- High to Low Range: This displays the total "volatility" of the current day by measuring the distance between the highest peak and the lowest valley reached so far today.
- Daily Average (DA): This is a more complex metric where the script analyzes historical daily price ranges over different timeframes (1, 5, 10, and 20 days). It calculates an average of these ranges to help you understand the typical "personality" or volatility of the currency pair. This value is also color-coded to show if the current day's average is trending higher or lower than the previous day.
User Experience & Customization
The script is built with user experience in mind, offering several ways to tailor how the information appears on your workspace:
- Visual Positioning: You can choose which corner of the chart the dashboard appears in (e.g., Top Right).
- Size Controls: It includes a "Smaller Size" toggle for traders who prefer a more compact, minimalist look.
- Layout Adjustment: If the text blocks overlap with other indicators or your layout, you can manually shift the position of the entire dashboard up, down, or side-to-side using built-in offset settings.
- Clean Exit: The script is programmed to "clean up" after itself. When you remove the indicator from your chart, it automatically deletes the text objects so no leftover labels remain on your screen.
Summary for the Trader
Think of this tool as a live ticker dashboard. It takes raw data—like historical averages and current price fluctuations—and simplifies them into a color-coded summary. This allows you to monitor market volatility, spread costs, and daily price trends instantly, helping you make more informed decisions without having to manually calculate these figures.
//+------------------------------------------------------------------+
//| #Signal_Bars_v3_Daily.mq4 |
//| Copyright © 2008, cja. |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, cja."
#property link " ccjjaa@gmail.com "
#property indicator_chart_window
extern bool Corner_of_Chart_RIGHT_TOP = true;
extern bool Show_Smaller_Size = false;
extern int Shift_UP_DN =0;
extern int Adjust_Side_to_side = 20;
extern color CommentLabel_color = LightSteelBlue;
//****************************************
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectDelete("SIG_INFO_1");ObjectDelete("SIG_INFO_2");
ObjectDelete("SIG_INFO_3");ObjectDelete("SIG_INFO_4");
ObjectDelete("SIG_INFO_5");ObjectDelete("SIG_INFO_6");
ObjectDelete("SIG_INFO_7");ObjectDelete("SIG_INFO_8");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//***********************************************************************************************************************
//MACD Signals
int counted_bars=IndicatorCounted();
//----
int R1=0,R5=0,R10=0,R20=0,RAvg=0,i=0;
R1 = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
for(i=1;i<=5;i++)
R5 = R5 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
for(i=1;i<=10;i++)
R10 = R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
for(i=1;i<=20;i++)
R20 = R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
R5 = R5/5;
R10 = R10/10;
R20 = R20/20;
RAvg = (R1+R5+R10+R20)/4;
string HI="",LO="",SPREAD="",PIPS="",DAV="",HILO="",PRC,Pips="",Av="",AV_Yest="";
color color_pip,color_av;
double OPEN = iOpen(NULL,1440,0);
double CLOSE = iClose(NULL,1440,0);
double SPRD = (Ask - Bid)/Point;
double High_Today = iHigh(NULL,1440,0);
double Low_Today = iLow(NULL,1440,0);
PIPS = DoubleToStr((CLOSE-OPEN)/Point,0);
SPREAD = (DoubleToStr(SPRD,Digits-4));
DAV = (DoubleToStr(RAvg,Digits-4));
AV_Yest = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
HILO = DoubleToStr((High_Today-Low_Today)/Point,0);
if (CLOSE >= OPEN) {Pips= "-";color_pip = Lime; }
if (CLOSE < OPEN) {Pips= "-";color_pip = OrangeRed; }
if (DAV > AV_Yest) {Av= "-";color_av = Lime; }
if (DAV < AV_Yest) {Av= "-";color_av = OrangeRed; }
if (Show_Smaller_Size == false)
{
ObjectCreate("SIG_INFO_1", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_1","Spread", 12, "Arial", CommentLabel_color);
ObjectSet("SIG_INFO_1", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_1", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
ObjectSet("SIG_INFO_1", OBJPROP_YDISTANCE, 20+Shift_UP_DN);
ObjectCreate("SIG_INFO_2", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_2",""+SPREAD+"", 12, "Arial Bold", Gold);
ObjectSet("SIG_INFO_2", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_2", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_2", OBJPROP_YDISTANCE, 20+Shift_UP_DN);
ObjectCreate("SIG_INFO_3", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_3","Pips to Open", 12, "Arial", CommentLabel_color);
ObjectSet("SIG_INFO_3", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_3", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
ObjectSet("SIG_INFO_3", OBJPROP_YDISTANCE, 37+Shift_UP_DN);
ObjectCreate("SIG_INFO_4", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_4",""+PIPS+"", 12, "Arial Bold", color_pip);
ObjectSet("SIG_INFO_4", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_4", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_4", OBJPROP_YDISTANCE, 37+Shift_UP_DN);
ObjectCreate("SIG_INFO_5", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_5","Hi to Low", 12, "Arial", CommentLabel_color);
ObjectSet("SIG_INFO_5", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_5", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
ObjectSet("SIG_INFO_5", OBJPROP_YDISTANCE, 54+Shift_UP_DN);
ObjectCreate("SIG_INFO_6", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_6",""+HILO+"", 12, "Arial Bold", Gold);
ObjectSet("SIG_INFO_6", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_6", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_6", OBJPROP_YDISTANCE, 54+Shift_UP_DN);
ObjectCreate("SIG_INFO_7", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_7","Daily Av", 12, "Arial",CommentLabel_color);
ObjectSet("SIG_INFO_7", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_7", OBJPROP_XDISTANCE, 45+Adjust_Side_to_side);
ObjectSet("SIG_INFO_7", OBJPROP_YDISTANCE, 71+Shift_UP_DN);
ObjectCreate("SIG_INFO_8", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_8",""+DAV+"", 12, "Arial Bold", color_av);
ObjectSet("SIG_INFO_8", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_8", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_8", OBJPROP_YDISTANCE, 71+Shift_UP_DN);
}
//***********************************************************************
if (Show_Smaller_Size == true)
{
ObjectCreate("SIG_INFO_1", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_1","Spread", 9, "Arial", CommentLabel_color);
ObjectSet("SIG_INFO_1", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_1", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
ObjectSet("SIG_INFO_1", OBJPROP_YDISTANCE, 20+Shift_UP_DN);
ObjectCreate("SIG_INFO_2", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_2",""+SPREAD+"", 9, "Arial Bold", Gold);
ObjectSet("SIG_INFO_2", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_2", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_2", OBJPROP_YDISTANCE, 20+Shift_UP_DN);
ObjectCreate("SIG_INFO_3", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_3","Pips to Open", 9, "Arial", CommentLabel_color);
ObjectSet("SIG_INFO_3", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_3", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
ObjectSet("SIG_INFO_3", OBJPROP_YDISTANCE, 35+Shift_UP_DN);
ObjectCreate("SIG_INFO_4", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_4",""+PIPS+"", 9, "Arial Bold", color_pip);
ObjectSet("SIG_INFO_4", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_4", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_4", OBJPROP_YDISTANCE, 35+Shift_UP_DN);
ObjectCreate("SIG_INFO_5", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_5","Hi to Low", 9, "Arial", CommentLabel_color);
ObjectSet("SIG_INFO_5", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_5", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
ObjectSet("SIG_INFO_5", OBJPROP_YDISTANCE, 50+Shift_UP_DN);
ObjectCreate("SIG_INFO_6", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_6",""+HILO+"", 9, "Arial Bold", Gold);
ObjectSet("SIG_INFO_6", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_6", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_6", OBJPROP_YDISTANCE, 50+Shift_UP_DN);
ObjectCreate("SIG_INFO_7", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_7","Daily Av", 9, "Arial",CommentLabel_color);
ObjectSet("SIG_INFO_7", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_7", OBJPROP_XDISTANCE, 40+Adjust_Side_to_side);
ObjectSet("SIG_INFO_7", OBJPROP_YDISTANCE, 65+Shift_UP_DN);
ObjectCreate("SIG_INFO_8", OBJ_LABEL, 0, 0, 0);
ObjectSetText("SIG_INFO_8",""+DAV+"", 9, "Arial Bold", color_av);
ObjectSet("SIG_INFO_8", OBJPROP_CORNER, Corner_of_Chart_RIGHT_TOP);
ObjectSet("SIG_INFO_8", OBJPROP_XDISTANCE, 10+Adjust_Side_to_side);
ObjectSet("SIG_INFO_8", OBJPROP_YDISTANCE, 65+Shift_UP_DN);
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments