Download MetaTrader 5

Display current timeframe.

To add comments, please log in or register
Have you discovered something really important? Write an article and receive 200 USD!
Amit Hapase
48
Amit Hapase 2014.01.19 19:18 

Hello. I want to display current time frame label on chart. Is there any indicator of it?

Thanks.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.01.19 19:42  
KingAmit1:

Hello. I want to display current time frame label on chart. Is there any indicator of it?

Thanks.

It's already there top left.
Amit Hapase
48
Amit Hapase 2014.01.19 19:45  
RaptorUK:
It's already there top left.


Hi. I want to display it in big font so I would need indicator to display it.

This is Market price label code. Can you modify and make this display timeframe label.

//+------------------------------------------------------------------+
//| Magnified Market Price.mq4        ver1.4             by Habeeb   |
//| Modified by FerruFX for Cobraforex THV System, www.cobraforex.com|
//+------------------------------------------------------------------+
#property indicator_chart_window
//----
  extern string note1="Change font colors automatically? True = Yes";
  extern bool   Bid_Ask_Colors=True;
  extern string note2="Default Font Color";
  extern color  FontColor=White;
  extern string note3="Font Size";
  extern int    FontSize=18;
  extern string note4="Font Type";
  extern string FontType="Segoe UI";
  extern string note5="Display the price in what corner?";
  extern string note6="Upper left=0; Upper right=1";
  extern string note7="Lower left=2; Lower right=3";
  extern int    WhatCorner=1;
  
  
//----


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   ObjectDelete("Market_Price_Label");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {   
   if (Bid_Ask_Colors==True)
     {
      if (iClose(NULL, 0, 0) > iOpen(NULL, 0, 0)) FontColor=DimGray;
      if (iClose(NULL, 0, 0) < iOpen(NULL, 0, 0)) FontColor=SaddleBrown;
     }
           
     
    
   //---- Define the standard digits
   int digits;
   string sub=StringSubstr(Symbol(), 4, 3);
   if(sub == "JPY") digits = 2;
   else digits = 4;
    
   string Market_Price=DoubleToStr(iClose(NULL, 0, 0), digits);
//----   
   ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Market_Price_Label", Market_Price+"  ", FontSize, FontType, FontColor);
   ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
   ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 1);
   ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, 1);
   
  } 
//+------------------------------------------------------------------+
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.01.19 19:50  
KingAmit1:


Hi. I want to display it in big font so I would need indicator to display it.

This is Market price label code. Can you modify and make this display timeframe label.

Yes I can . . . but I'm not here to code for you, learn or pay someone to do it: MT4 & MT5 coding jobs
To add comments, please log in or register