跳至内容

ChartTimePriceToXY

ChartTimePriceToXY

将图表的坐标从时间/价格表示方式转换为X和Y坐标。

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
   );

参数

chart_id

[in] 图表ID。0表示当前图表。

sub_window

[in] 图表子窗口的编号。0表示主图表窗口。

time

[in] 图表上的时间值,将获取X轴上对应的像素值。

price

[in] 图表上的价格值,将获取Y轴上对应的像素值。

x

[out] 变量,将接收时间到X的转换结果。原点位于主图表窗口的左上角。

y

[out] 变量,将接收价格到Y的转换结果。原点位于主图表窗口的左上角。

返回值

成功则返回true,否则返回false。要获取关于错误的信息,请调用GetLastError()函数。

另请参阅

ChartXYToTimePrice()

最后更新于