When I use ChartTimePriceToXY and the chart is not active the X and Y values extrapolate the chart size values obtained through the CHART_WIDTH_IN_PIXELS and CHART_HEIGHT_IN_PIXELS properties.
Is this a bug?
The result of the code below for active and non-active charts is:
width=1578 height=700 x=1392 y=615 top=true
width=195 height=77 x=1536 y=-25 top=false
Note that the value of X is greater than the value of width, and the value of Y is less than height
void getXY()
{
MqlRates candles[];
long width, height;
int x = 0;
int y = 0;
bool top;
CopyRates(_Symbol, _Period, 0, 5, candles);
ArraySetAsSeries(candles, true);
width = ChartGetInteger(0, CHART_WIDTH_IN_PIXELS);
height = ChartGetInteger(0, CHART_HEIGHT_IN_PIXELS);
top = ChartGetInteger(0, CHART_BRING_TO_TOP);
ResetLastError();
if(!ChartTimePriceToXY(0, 0, candles[0].time, candles[0].close, x, y))
{
Print("Error to get X and Y positions - error n.", GetLastError());
}
Print(" width=", width, " height=", height, " x=", x, " y=", y, " top=", top);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
When I use ChartTimePriceToXY and the chart is not active the X and Y values extrapolate the chart size values obtained through the CHART_WIDTH_IN_PIXELS and CHART_HEIGHT_IN_PIXELS properties.
Is this a bug?
The result of the code below for active and non-active charts is:
width=1578 height=700 x=1392 y=615 top=true
width=195 height=77 x=1536 y=-25 top=false
Note that the value of X is greater than the value of width, and the value of Y is less than height