macpee:
当前图表的Y轴上一个像素的值是多少?预先谢谢你。
当前图表的Y轴上一个像素的值是多少?预先谢谢你。
价值? 一个像素并没有 "值"。
你是什么意思?
macpee:
当前图表的Y轴上一个像素的值是多少?先谢谢你。
我认为它甚至不在外汇中当前图表的Y轴上一个像素的值是多少?先谢谢你。
这是在Photoshop中;)
也许你正在发送至另一个网站
Alain Verleyen:
如果一个像素没有值,那么怎么可能用x轴和y轴画线(当然这些变量以像素为单位取值)或创建使用坐标的按钮等?
价值? 一个像素没有 "价值"。
你是什么意思?
double max_price = ChartGetDouble(0,CHART_PRICE_MAX),
min_price = ChartGetDouble(0,CHART_PRICE_MIN);
long chart_height = ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS);
printf("1 pixel = %f",(max_price-min_price)/chart_height);
min_price = ChartGetDouble(0,CHART_PRICE_MIN);
long chart_height = ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS);
printf("1 pixel = %f",(max_price-min_price)/chart_height);
honest_knave:
非常感谢。我想这是一个更好的答复,我必须尝试使用。
double max_price = ChartGetDouble(0,CHART_PRICE_MAX),
min_price = ChartGetDouble(0,CHART_PRICE_MIN);
long chart_height = ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS);
printf("1 pixel = %f",(max_price-min_price)/chart_height);
min_price = ChartGetDouble(0,CHART_PRICE_MIN);
long chart_height = ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS);
printf("1 pixel = %f",(max_price-min_price)/chart_height);
macpee:
如果一个像素没有值,那么怎么可能用x轴和y轴画线(当然这些变量以像素为单位取值)或创建使用坐标的按钮等?
如果一个像素没有值,那么怎么可能用x轴和y轴画线(当然这些变量以像素为单位取值)或创建使用坐标的按钮等?
请看:https://www.mql5.com/en/docs/chart_operations/chartxytotimeprice

Documentation on MQL5: Chart Operations / ChartXYToTimePrice
- www.mql5.com
Chart Operations / ChartXYToTimePrice - Reference on algorithmic/automated trading language for MetaTrader 5
macpee:
如果一个像素没有一个值,那么如何使用X和Y轴画线(当然这些变量以像素为单位取值)或创建使用坐标的按钮等?
如果一个像素没有一个值,那么如何使用X和Y轴画线(当然这些变量以像素为单位取值)或创建使用坐标的按钮等?
可能值得一提的是,有2种不同的方式来绘制对象。
- 使用时间/价格...如OBJ_TREND和OBJ_TEXT
- 当你向左/右/上/下滚动图表时,这些对象将沿着屏幕移动。
- 使用X/Y像素...如OBJ_BUTTON和OBJ_LABEL
- 这些对象不会在屏幕上移动,即使图表滚动。
有时有必要把这些东西混在一起,比如你想在X轴上画一个相对于时间的对象,而在Y轴上画像素。
在这种情况下,你会想使用ChartXYToTimePrice() 或ChartTimePriceToXY(),正如Marco所建议的。
哇!我觉得这个应该很有用。我想这个应该是很有用的。非常感谢。我将把它与下面的反向函数结合起来。
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
);
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
);
macpee:
哇!我想这个应该是很有用的。非常感谢。我将把它与下面的反向函数结合起来。
根据这个逻辑,像素坐标0,0处的价格是多少?为什么它不是0?又为什么它在你滚动终端中的数据时发生变化?为什么当你改变显示图表的比例或改变图表的缩放时,它也会改变?为什么在形成新的条形图时,它在相同的像素上发生变化?为什么你的终端和我的终端在相同的像素坐标上是不同的?在有价格的地方使用价格,除非你打算交易像素
哇!我想这个应该是很有用的。非常感谢。我将把它与下面的反向函数结合起来。
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
);
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
);
我需要这个值,以便我可以计算出600像素的值。
这是因为我想要600像素的止盈水平,而不是600点或600点。
我希望在所有图表上有一个统一的获利水平,无论其点值或点值如何。
现在是以像素为单位进行交易的时候了。谢谢大家。