trigger event when crosshair is clicked

 

I want to get Price where Crosshair is clicked, How can i code this event?

 
if(sparam=="16"){
  double price;
  datetime time;
  int subwindow;
  ChartXYToTimePrice(NULL,(int)lparam,(int)dparam,subwindow,time,price);
}
        
Not tested, just an idea... I assume you know what sparam, lparam, dparam etc is?
 
Arpit T: I want to get Price where Crosshair is clicked, How can i code this event?

Perhaps you should read the manual.
   How To Ask Questions The Smart Way. (2004)
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.

Look for CHARTEVENT_CLICK. OnChartEvent - Event Handling - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5

However, there is no way to know whether the Crosshair is active or not.

Reason: