Download MetaTrader 5

How to use the function of ChartTimePriceToXY()?

To add comments, please log in or register
liu.solomon
13
liu.solomon  

When I use the function of ChartTimePriceToXY() to convert time and price coordination to x and y coordination, I need transfer the time and price and address of x and address of y to the function, the prototyeof this function is as follows:

bool  ChartTimePriceToXY(
   long           chart_id,     // Chart ID
   int            sub_window,   // The number of the subwindow
   datetime       time,         // Time on the chart
   double         price,        // Price on the chart
   int&           x,            // The X coordinate for the time on the chart
   int&           y             // The Y coordinates for the price on the chart

   );

When I use it, there are allways wrong report. This  is how I use it:

ChartTimePriceToXY(0,0,time1[j],price1[j],&xxx[j],&yyy[j]);

This doesn't work. Then I changed. I use it like this:

ChartTimePriceToXY(0,0,time1[j],price1[j],xxx[j],yyy[j]);

This is not right too.

Please tell me how to fix it, and Thank you very much!

Vladimir Karputov
Moderator
50016
Vladimir Karputov  
ChartTimePriceToXY(0,0,time1[j],price1[j],xxx[j],yyy[j]);
This is the right option. Perhaps the error is associated with arrays xxx and yyy.
To add comments, please log in or register