i need to display and update OPEN,HIGH,LOW,CLOSE AND LTP values in a chart - page 2

 
Marco vd Heijden:

Then you have to code it.

It's not that hard.

You can use 

Thanks lot sir, I check it and let you update 
 

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                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetMillisecondTimer(500);
//---
   chartwidth=ChartGetInteger(0,CHART_WIDTH_IN_PIXELS);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();
//---
   ObjectsDeleteAll(0,-1,OBJ_LABEL);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   update();
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
    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(const long              chart_ID=0,               // chart's ID 
                 const string            name="Label",             // label name 
                 const int               sub_window=0,             // subwindow index 
                 const int               x=0,                      // X coordinate 
                 const int               y=0,                      // Y coordinate 
                 const ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER, // chart corner for anchoring 
                 const string            text="Label",             // text 
                 const string            font="Arial",             // font 
                 const int               font_size=10,             // font size 
                 const color             clr=clrRed,               // color 
                 const double            angle=0.0,                // text slope 
                 const ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_UPPER, // anchor type 
                 const bool              back=false,               // in the background 
                 const bool              selection=false,          // highlight to move 
                 const bool              hidden=true,              // hidden in the object list 
                 const long              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);
  }
//+------------------------------------------------------------------+ 
Finish it and post the resulting code here.
 
Marco vd Heijden:

Then you have to code it.

It's not that hard.

You can use 

Marco vd Heijden:

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

 
I just did.
 

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.
 
Marco vd Heijden:
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.

Reason: