MT4中的填充矩形

 
你好,我一直想通过Meta编辑器来实现这个功能,但我不是程序员,所以你可能已经猜到了,我根本就没有成功。有谁知道如何使MT4中的矩形被填上颜色?
 
 
honest_knave:

OBJPROP_FILL

但我在哪里做呢? 介意指导我吗?
 

当然,把你创建矩形的代码贴出来,我会告诉你它的位置。

 
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);
  }
 
honest_knave:

这样做了,但还是没有用。当我勾选"将物体画成背景 "时,整个物体变得透明并消失了,但当我不勾选它时,形状仍然是空的。
 
  1. 不要粘贴代码
    播放视频
    编辑 你的帖子。
    对于大量的代码,请附上它。

  2. 比较你的帖子
    jakubdonovan36: 它仍然不能工作。
    // ObjectSetInteger(chart_id,name,OBJPROP_FILL,clrGray);LINE ?
    和我的建议
    honest_knave:
      ObjectSetInteger(chart_id,name,OBJPROP_FILL,true);  LINE 1
    你说要填充,但没有设置要填充什么颜色。来自ObjectSetInteger - MQL4文档
    ObjectSetInteger(0,name,OBJPROP_COLOR,clrBlack);         LINE 2
 
WHRoeder:
你说要填充,但没有设置填充什么颜色。来自ObjectSetInteger - MQL4文档



它仍然不工作。

//|创建对象 "矩形" |
//+------------------------------------------------------------------+
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)。
 
WHRoeder:
你说要填充它,但没有设置填充什么颜色。来自ObjectSetInteger - MQL4文档



对如何使薄片工作有什么建议吗?
 
honest_knave:

有什么建议可以使其发挥作用吗?