Download MetaTrader 5

How to get the bar number/time from OnChartEvent()?

To add comments, please log in or register
Rasoul Mojtahedzadeh
28328
Rasoul Mojtahedzadeh  
In an Expert Advisor code, I would like to know on which bar of a chart the user clicked. From the example and documentation of OnChartEvent() function, a left click of mouse can be captured as a position (x, y). Is there a way to get the bar time/number on which the user left clicked?
Keith Watford
Moderator
9641
Keith Watford  

ChartXYToTimePrice

then

iBarShift 

Rasoul Mojtahedzadeh
28328
Rasoul Mojtahedzadeh  
GumRai:

ChartXYToTimePrice

then

iBarShift 


Thanks! 
To add comments, please log in or register