OnChartEvent的像素坐标如何转换成K线坐标?

 

我想要获取单击图表CHARTEVENT_CLICK的坐标,但是lparam和dparam是获取的像素的坐标,怎么转换成K线的坐标。

因为获取完坐标之后,下一步想画线。

 

参考:

bool  ChartXYToTimePrice( 
   long           chart_id,     // Chart ID 
   int            x,            // The X coordinate on the chart 
   int            y,            // The Y coordinate on the chart 
   int&           sub_window,   // The number of the subwindow 
   datetime&      time,         // Time on the chart 
   double&        price         // Price on the chart 
   );
 
Ziheng Zhuang:

参考:

已解决,感谢!
原因: