MQL5 ChartXYToTimePrice getting error 4107 and I'm stumped

 

I have officially moved to MQL5 although it's gonna take time to port all my code over.

At least, I thought, I won't have the same problem with ChartXYToTimePrice that I was having in MQL4.

And I don't! I now have a completely different problem lol.

In MQL4 ChartXYToTimePrice worked in debug but not in a real run.

In MQL5 ChartXYToTimePrice won't work in debug, period. I'm getting an error 4107 ERR_CHART_WRONG_PARAMETER "Error value of the parameter for the function of working with charts".

I get exactly the same error when I run the script on a chart with the same symbol/time period/template.

#property strict



void OnStart()

  {

   int m_sub_window;

   datetime dtDTM=0;

   double price=0.0;

   ChartRedraw(0);

   ResetLastError();

   bool bRslt = ChartXYToTimePrice(0,3300,1300,m_sub_window,dtDTM,price);

   int iErr = _LastError;



   return;   

  }

Anyone got a clue? I'm probably just point-blind to the wart on my nose...

 
Where is the chart point with X=3300  and y=1300 ?
 
Alain Verleyen:
Where is the chart point with X=3300  and y=1300 ?


WAT? You mean I have to choose a point that's actually on the chart?

Whodathunk?




Thanks man. Those nose warts, I tell ya, gonna be the death of me yet.