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?
- Rectangle to fill or not to fill?
- rectangle style
- how to plot empty, no-filled candles in mql4
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); }
-
Play videoPlease edit your post.
For large amounts of code, attach it.
compare your post jakubdonovan36: It still doesn't work.// ObjectSetInteger(chart_id,name,OBJPROP_FILL,clrGray); LINE ?with my suggestion. honest_knave:You say to fill it, but don't set what color to fill. From ObjectSetInteger - MQL4 DocumentationObjectSetInteger(chart_id,name,OBJPROP_FILL,true); LINE 1
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
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?
You say to fill it, but don't set what color to fill. From ObjectSetInteger - MQL4 Documentation
honest_knave:
Any suggestions on how to make this work?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register