Get x and y coordinates in strategy tester - visual mode

To add comments, please log in or register
Martin Moreno
153
Martin Moreno  

Hi guys,

need to get x and y coordinates of the chart in visual mode. Is there any way to do this?

I use ChartXYToTimePrice() in real mode and I call this function in OnChartEvent to get X and Y coordinates by click on chart.

But OnChartEvent() is not working in strategy tester - visual mode .

William Roeder
20233
William Roeder  
Martin Moreno: But OnChartEvent() is not working in strategy tester - visual mode .
See In backtest OnTimer() not performs (M. Ali) - MQL4 programming forum and work around Chart Event For MT4 Backtester (Migel) - MQL4 programming forum
Keith Watford
Moderator
20526
Keith Watford  

I've never had reason to do this in the tester, but I suppose that you could use say an arrow object.

Check in OnTick() to see if the object is selected. If it is set a static bool to true.

Move the object anchor point with the mouse and de-select it.

Every tick, if the bool is true, check to see is it is now de-selected

in which case, set the bool to false and get the time/price co-ordinates of the object anchor and then the x/y co-ordinates.

Martin Moreno
153
Martin Moreno
153
Martin Moreno  
Keith Watford:

I've never had reason to do this in the tester, but I suppose that you could use say an arrow object.

Check in OnTick() to see if the object is selected. If it is set a static bool to true.

Move the object anchor point with the mouse and de-select it.

Every tick, if the bool is true, check to see is it is now de-selected

in which case, set the bool to false and get the time/price co-ordinates of the object anchor and then the x/y co-ordinates.

Thank you Keith

To add comments, please log in or register