你好,我一直想通过Meta编辑器来实现这个功能,但我不是程序员,所以你可能已经猜到了,我根本就没有成功。有谁知道如何使MT4中的矩形被填上颜色?
但我在哪里做呢? 介意指导我吗?
当然,把你创建矩形的代码贴出来,我会告诉你它的位置。
honest_knave:
当然,把你创建矩形的代码贴出来,我会告诉你它的位置。
+------------------------------------------------------------------+
//|创建对象 "矩形" |
//+------------------------------------------------------------------+
bool CChartObjectRectangle::Create(long chart_id,const string name,const int window,
const datetime time1,const double price1,
const datetime time2,const double price2)
{
if(!ObjectCreate(chart_id,name,OBJ_RECTANGLE,window,time1,price1,time2,price2))
返回(false)。
if(!Attach(chart_id,name,window,2))
return(false)。
//---成功
return(true);
}
+------------------------------------------------------------------+ //| Create object "Rectangle" | //+------------------------------------------------------------------+ bool CChartObjectRectangle::Create(long chart_id,const string name,const int window, const datetime time1,const double price1, const datetime time2,const double price2) { if(!ObjectCreate(chart_id,name,OBJ_RECTANGLE,window,time1,price1,time2,price2)) return(false); ObjectSetInteger(chart_id,name,OBJPROP_FILL,true); if(!Attach(chart_id,name,window,2)) return(false); //--- successful return(true); }
-
播放视频请编辑 你的帖子。
对于大量的代码,请附上它。
比较你的帖子 jakubdonovan36: 它仍然不能工作。// ObjectSetInteger(chart_id,name,OBJPROP_FILL,clrGray);LINE ?和我的建议。 honest_knave:你说要填充,但没有设置要填充什么颜色。来自ObjectSetInteger - MQL4文档ObjectSetInteger(chart_id,name,OBJPROP_FILL,true); LINE 1
ObjectSetInteger(0,name,OBJPROP_COLOR,clrBlack); LINE 2
它仍然不工作。
//|创建对象 "矩形" |//+------------------------------------------------------------------+
bool CChartObjectRectangle::Create(long chart_id,const string name,const int window,
const datetime time1,const double price1,
const datetime time2,const double price2)
{
if(!ObjectCreate(chart_id,name,OBJ_RECTANGLE,window,time1,price1,time2,price2))
返回(false)。
ObjectSetInteger(chart_id,name,OBJPROP_FILL,clrGray)。
if(!Attach(chart_id,name,window,2))
return(false)。
//---成功
return(true)。
对如何使薄片工作有什么建议吗?
honest_knave:
有什么建议可以使其发挥作用吗?