# Problem with ChartTimePriceToXY

13

Hello everyone,

I am writing the expert, which is used ChartTimePriceToXY. When I tested it, this function work incorrect. Every time it returns 2147483647. I realise that it is 2^31 - 1, which is mean EMPTY_VALUE in this system, but I absolutely dont know why it happens.

Part of my code:

```double lips = iAlligator(Symbol(), Period(), 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, i);

double teeth = iAlligator(Symbol(), Period(), 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, i);

double jaw = iAlligator(Symbol(), Period(), 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, i);

double alligatorPoint = (lips + teeth + jaw) / 3;

double barPoint = (Low[i] + High[i]) / 2;

int alligatorX, alligatorY;

ChartTimePriceToXY(0, 0, Time[i], alligatorPoint, alligatorX, alligatorY); ```

And the most weard thing is, that if I try to run this code in the indicator, everything is good (function return valid values).

Guys, I need your help. Thank you.

16096

Alankras: Every time it returns 2147483647.
1.  Play video Please edit your post. For large amounts of code, attach it.

2. ChartTimePriceToXY - MQL4 Documentation returns a bool. it can't return EMPTY_VALUE

13

WHRoeder:
1.  Play video Please edit your post. For large amounts of code, attach it.

2. ChartTimePriceToXY - MQL4 Documentation returns a bool. it can't return EMPTY_VALUE

You are right, but I meant that the value of alligatorX, alligatorY are not valid after.

16096

13

I already did that. For example, GetLastError() return 0 everytime, ChartTimePriceToXY return true.

Anyway, thank you for your help.

13

I find solution. In the expert tester, some function doesnt work, e.g. graphical fucntion, that is why ChartTimePriceToXY  return bad values. To avoid this, I use tester with visualization and everything is fine.

Hope it helps anyone.

256

.