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.
You are right, but I meant that the value of alligatorX, alligatorY are not valid after.
I already did that. For example, GetLastError() return 0 everytime, ChartTimePriceToXY return true.
Anyway, thank you for your help.
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.
To add comments, please log in or register