How can I get Candle information By click on it

 

Hi friend ,

Is it possible to get High and Low of a candle by click on it?

I need ti get information of a candle by click on it.

 

Hi,

Unfortunately there is not any built in function,maybe there will be indicator can do it for it,so google it,

But you can do CTRL+D on chart,then will see the data window,cursor should be on which candle you want to see its data.

Also you can see the exact indicator data on data window.

 
Mehrdad Jeddi:

Hi,

Unfortunately there is not any built in function,maybe there will be indicator can do it for it,so google it,

But you can do CTRL+D on chart,then will see the data window,cursor should be on which candle you want to see its data.

Also you can see the exact indicator data on data window.

Here you go bro. Just put your mouse cursor on any candle and you can see it from below where i circled it red for u to see. The high, love open and close all will appear. 

Files:
Help.png  100 kb
 
Bilalkhan19:

Here you go bro. Just put your mouse cursor on any candle and you can see it from below where i circled it red for u to see. The high, love open and close all will appear. 

I need to get this information in order to calculate on them.
I mean when I click on a candle , get OHLC of the candle and calculate on them. Is there any function in mql4 to do this functionality for me?

 
Martin Moreno:

I need to get this information in order to calculate on them.
I mean when I click on a candle , get OHLC of the candle and calculate on them. Is there any function in mql4 to do this functionality for me?

Just adding these lines in OnChartEvent() function of your EA or indicator will do:

   if(id==CHARTEVENT_CLICK)
     {
      datetime time = 0;
      double price = 0;
      int window = 0;
      if (ChartXYToTimePrice(ChartID(),int(lparam),int(dparam),window,time,price))
      {
         int bar = iBarShift(Symbol(),Period(),time);
         Print ("bar = ", bar, ", high = ", iHigh(Symbol(),Period(),bar), ", low = ", iLow(Symbol(),Period(),bar));
      }
     }
 
Seng Joo Thio:

Just adding these lines in OnChartEvent() function of your EA or indicator will do:

Thanks a lot. BIG LIKE bro

 
Seng Joo Thio:

Just adding these lines in OnChartEvent() function of your EA or indicator will do:

Thanks . This is really master pics.

 
Seng Joo Thio #:

Just adding these lines in OnChartEvent() function of your EA or indicator will do:

Tanks a lot. You are the best my friend. Gods hand with you.
 

When you click on same candle you can receive 2 bar identifiers.

In order to have same bar ID at every point of a candle you can use this modified code of Seng Joo Thio original version

if (id == CHARTEVENT_CLICK) {
   datetime time = 0;
   double price = 0;
   int window = 0;
   if (ChartXYToTimePrice(ChartID(), int(lparam), int(dparam), window, time, price)) {
      datetime normalizedTime = time + (PeriodSeconds() / 2);
      int bar = iBarShift(Symbol(), Period(), normalizedTime);
      Print("bar = ", bar, ", high = ", iHigh(Symbol(), Period(), bar), ", low = ", iLow(Symbol(), Period(), bar), ", time = ", time);
   }
}
Reason: