Here i made a beginning but not finished yet you have to finish it.
//+------------------------------------------------------------------+//| Monitor.mq5 |//| Copyright 2018, Marco vd Heijden, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+#property copyright"Copyright 2018, Marco vd Heijden, MetaQuotes Software Corp."#property link"https://www.mql5.com"#property version"1.00"long chartwidth;
//+------------------------------------------------------------------+//| Expert initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- create timerEventSetMillisecondTimer(500);
//---
chartwidth=ChartGetInteger(0,CHART_WIDTH_IN_PIXELS);
//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Expert deinitialization function |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
//--- destroy timerEventKillTimer();
//---ObjectsDeleteAll(0,-1,OBJ_LABEL);
}
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
//---
update();
}
//+------------------------------------------------------------------+//| Timer function |//+------------------------------------------------------------------+voidOnTimer()
{
//---ObjectSetString(0,"symbol",OBJPROP_TEXT,_Symbol);
ObjectSetString(0,"ltp",OBJPROP_TEXT,"FIX THIS");
double open=iOpen(_Symbol,PERIOD_D1,0);
ObjectSetString(0,"open",OBJPROP_TEXT,DoubleToString(open));
double high=iHigh(_Symbol,PERIOD_D1,0);
ObjectSetString(0,"high",OBJPROP_TEXT,DoubleToString(high));
double low=iLow(_Symbol,PERIOD_D1,0);
ObjectSetString(0,"low",OBJPROP_TEXT,DoubleToString(low));
ObjectSetString(0,"servertime",OBJPROP_TEXT,TimeToString(TimeCurrent(),TIME_SECONDS));
ObjectSetString(0,"localtime",OBJPROP_TEXT,TimeToString(TimeLocal(),TIME_SECONDS));
ChartRedraw();
}
//+------------------------------------------------------------------+void update()
{
if(ObjectFind(0,"SYMBOL")<0)
{
int width=chartwidth/7;
LabelCreate(0,"SYMBOL",0,10,30,CORNER_LEFT_UPPER,"SYMBOL","Arial",12,clrWhite);
LabelCreate(0,"LTP",0,width,30,CORNER_LEFT_UPPER,"LTP","Arial",12,clrWhite);
LabelCreate(0,"OPEN",0,width*2,30,CORNER_LEFT_UPPER,"OPEN","Arial",12,clrWhite);
LabelCreate(0,"HIGH",0,width*3,30,CORNER_LEFT_UPPER,"HIGH","Arial",12,clrWhite);
LabelCreate(0,"LOW",0,width*4,30,CORNER_LEFT_UPPER,"LOW","Arial",12,clrWhite);
LabelCreate(0,"ServerTime",0,width*5,30,CORNER_LEFT_UPPER,"ServerTime","Arial",12,clrWhite);
LabelCreate(0,"LocalTime",0,width*6,30,CORNER_LEFT_UPPER,"LocalTime","Arial",12,clrWhite);
//--- second row
LabelCreate(0,"symbol",0,10,50,CORNER_LEFT_UPPER,_Symbol,"Arial",14,clrLime);
LabelCreate(0,"ltp",0,width,50,CORNER_LEFT_UPPER,"LTP","Arial",14,clrLime);
double open=iOpen(_Symbol,PERIOD_D1,0);
LabelCreate(0,"open",0,width*2,50,CORNER_LEFT_UPPER,DoubleToString(open),"Arial",14,clrLime);
double high=iHigh(_Symbol,PERIOD_D1,0);
LabelCreate(0,"high",0,width*3,50,CORNER_LEFT_UPPER,DoubleToString(high),"Arial",14,clrLime);
double low=iLow(_Symbol,PERIOD_D1,0);
LabelCreate(0,"low",0,width*4,50,CORNER_LEFT_UPPER,DoubleToString(low),"Arial",14,clrLime);
LabelCreate(0,"servertime",0,width*5,50,CORNER_LEFT_UPPER,TimeToString(TimeCurrent(),TIME_SECONDS),"Arial",12,clrLime);
LabelCreate(0,"localtime",0,width*6,50,CORNER_LEFT_UPPER,TimeToString(TimeLocal(),TIME_SECONDS),"Arial",12,clrLime);
ChartRedraw();
}
}
//+------------------------------------------------------------------+ //| Create a text label | //+------------------------------------------------------------------+ bool LabelCreate(constlong chart_ID=0, // chart's ID conststring name="Label", // label name constint sub_window=0, // subwindow index constint x=0, // X coordinate constint y=0, // Y coordinate constENUM_BASE_CORNER corner=CORNER_LEFT_UPPER, // chart corner for anchoring conststring text="Label", // text conststring font="Arial", // font constint font_size=10, // font size constcolor clr=clrRed, // color constdouble angle=0.0, // text slope constENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_UPPER, // anchor type constbool back=false, // in the background constbool selection=false, // highlight to move constbool hidden=true, // hidden in the object list constlong z_order=0) // priority for mouse click
{
//--- reset the error value ResetLastError();
//--- create a text label if(!ObjectCreate(chart_ID,name,OBJ_LABEL,sub_window,0,0))
{
Print(__FUNCTION__,
": failed to create text label! Error code = ",GetLastError());
return(false);
}
//--- set label coordinates ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
//--- set the chart's corner, relative to which point coordinates are defined ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);
//--- set the text ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);
//--- set text font ObjectSetString(chart_ID,name,OBJPROP_FONT,font);
//--- set font size ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);
//--- set the slope angle of the text ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,angle);
//--- set anchor type ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);
//--- set color ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- display in the foreground (false) or background (true) ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- enable (true) or disable (false) the mode of moving the label by mouse ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- hide (true) or display (false) graphical object name in the object list ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- set the priority for receiving the event of a mouse click in the chart ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- successful execution return(true);
}
//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Then you have to code it.
It's not that hard.
You can use
Here i made a beginning but not finished yet you have to finish it.

Finish it and post the resulting code here.Then you have to code it.
It's not that hard.
You can use
Here i made a beginning but not finished yet you have to finish it.
Finish it and post the resulting code here.Dear Sir
I dont have much coding knowledge, i request you to kindly help on this
Thank you sir.. but i when copied and pasted , it didnt show anything in my chart
my chart looks like as follows
It's an expert, not indicator, on MT5.
Oh my god.. i actually requested indicator in mq4
my request is, almost done..
but slight work is there.
LTP ( Last Traded Price ) so, it should display the latest execution price on the script
Open , High, Low and Close values are to be printed as double digits..
I think it is done almost
It should be in bottom.. not at top of chart
all digits must be in 2 digits.
and LTP means, last trade price.