Filled Rectangles in MT4

 
Hello lads, so i have been trying to get this to work via Meta Editor but i am no coder so as you might have guessed, i haven't been successful at all. Does anyone have any idea how to make it so that the rectangles in MT4 are filled with colour?
 
 
honest_knave:

OBJPROP_FILL

 

But where do i do that? mind guiding me?
 

Sure, post up your code that creates the rectangle and I'll show you where it goes.

 
honest_knave:

Sure, post up your code that creates the rectangle and I'll show you where it goes.

+------------------------------------------------------------------+
//| 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);
   if(!Attach(chart_id,name,window,2))
      return(false);
//--- successful
   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:

did that and it still doesn't work. When I check ''draw object as background'' the whole thing becomes transparent and disappears, but when i leave it unchecked, the shape is still empty :/
 
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. compare your post
    jakubdonovan36: It still doesn't work.
    //   ObjectSetInteger(chart_id,name,OBJPROP_FILL,clrGray);  LINE ?
    with my suggestion.
    honest_knave:
      ObjectSetInteger(chart_id,name,OBJPROP_FILL,true);  LINE 1
    You say to fill it, but don't set what color to fill. From ObjectSetInteger - MQL4 Documentation
    ObjectSetInteger(0,name,OBJPROP_COLOR,clrBlack);         LINE 2
 
WHRoeder:
You say to fill it, but don't set what color to fill. From ObjectSetInteger - MQL4 Documentation



It still doesn't work.

//| 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,clrGray);
   if(!Attach(chart_id,name,window,2))
      return(false);
//--- successful
   return(true);
 
WHRoeder:
You say to fill it, but don't set what color to fill. From ObjectSetInteger - MQL4 Documentation



Any suggestions on how to make thins work?
 
honest_knave:

Any suggestions on how to make this work?
Reason: