chart event

 

Hi

I wana know that is there a way to get the bar properties of the clicked position on the chart ?

I mean i want to click on a position on chart and for example the date of clicked position returned.

thanks. 

 
pumper:

Hi

I wana know that is there a way to get the bar properties of the clicked position on the chart ?

I mean i want to click on a position on chart and for example the date of clicked position returned.

thanks. 

You have to create a CI (or EA) for that. To get the X and Y of chart pixel coordinates, use OnChartEvent with CHARTEVENT_CLICK  (event of a mouse click on the chart). Convert those X and Y pixel coordinates to X and Y time-price coordinates using ChartXYToTimePrice. From there, you get the time and price data, which can be used with any copy function from Timeseries and Indicators Access
 
phi.nuts:
You have to create a CI (or EA) for that. To get the X and Y of chart pixel coordinates, use OnChartEvent with CHARTEVENT_CLICK  (event of a mouse click on the chart). Convert those X and Y pixel coordinates to X and Y time-price coordinates using ChartXYToTimePrice. From there, you get the time and price data, which can be used with any copy function from Timeseries and Indicators Access
thanks for replay just the function i'v looking for
 

if i have 2 CI and both of them capture mouse clicks.

How to recognise wich click iss for wich indicator ? 

 
pumper:

if i have 2 CI and both of them capture mouse clicks.

How to recognise wich click iss for wich indicator ? 

Pumper, if it is click on chart, you know that can't be done, perhaps some sort of click on button will solve the problem

Anyway, what the click on second indicator do ?

Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events - Documentation on MQL5
 

I made it with adding a  button to each indicator

Reason: