Don't know what just happened to my previous post (was about CChartObject::Fill(const bool new_fill) ...) But post up more of your code where you actually call this to create your rectangle.
honest_knave: Don't know what just happened to my previous post (was about CChartObject::Fill(const bool new_fill) ...) But post up more of your code where you actually call this to create your rectangle.
Sure, here it is:
//+------------------------------------------------------------------+//| ChartObjectsShapes.mqh |//| Copyright 2009-2013, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+//| All shapes. |//+------------------------------------------------------------------+#include "ChartObject.mqh"//+------------------------------------------------------------------+//| Class CChartObjectRectangle. |//| Purpose: Class of the "Rectangle" object of chart. |//| Derives from class CChartObject. |//+------------------------------------------------------------------+class CChartObjectRectangle : public CChartObject
{
public:
CChartObjectRectangle(void);
~CChartObjectRectangle(void);
//--- method of creating the objectbool Create(long chart_id,conststring name,constint window,
constdatetime time1,constdouble price1,
constdatetime time2,constdouble price2);
//--- method of identifying the objectvirtualint Type(void) const { return(OBJ_RECTANGLE); }
};
//+------------------------------------------------------------------+//| Constructor |//+------------------------------------------------------------------+
CChartObjectRectangle::CChartObjectRectangle(void)
{
}
//+------------------------------------------------------------------+//| Destructor |//+------------------------------------------------------------------+
CChartObjectRectangle::~CChartObjectRectangle(void)
{
}
+------------------------------------------------------------------+
//| Create object "Rectangle" |//+------------------------------------------------------------------+bool CChartObjectRectangle::Create(long chart_id,conststring name,constint window,
constdatetime time1,constdouble price1,
constdatetime time2,constdouble 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);
//--- successfulreturn(true);
}
//+------------------------------------------------------------------+//| Class CChartObjectTriangle. |//| Purpose: Class of the "Triangle" object of chart. |//| Derives from class CChartObject. |//+------------------------------------------------------------------+class CChartObjectTriangle : public CChartObject
{
public:
CChartObjectTriangle(void);
~CChartObjectTriangle(void);
//--- method of creating the objectbool Create(long chart_id,conststring name,constint window,
constdatetime time1,constdouble price1,
constdatetime time2,constdouble price2,
constdatetime time3,constdouble price3);
//--- method of identifying the objectvirtualint Type(void) const { return(OBJ_TRIANGLE); }
};
//+------------------------------------------------------------------+//| Constructor |//+------------------------------------------------------------------+
CChartObjectTriangle::CChartObjectTriangle(void)
{
}
//+------------------------------------------------------------------+//| Destructor |//+------------------------------------------------------------------+
CChartObjectTriangle::~CChartObjectTriangle(void)
{
}
//+------------------------------------------------------------------+//| Create object "Triangle" |//+------------------------------------------------------------------+bool CChartObjectTriangle::Create(long chart_id,conststring name,constint window,
constdatetime time1,constdouble price1,
constdatetime time2,constdouble price2,
constdatetime time3,constdouble price3)
{
if(!ObjectCreate(chart_id,name,OBJ_TRIANGLE,window,time1,price1,time2,price2,time3,price3))
return(false);
if(!Attach(chart_id,name,window,3))
return(false);
//--- successfulreturn(true);
}
//+------------------------------------------------------------------+//| Class CChartObjectEllipse. |//| Purpose: Class of the "Ellipse" object of chart. |//| Derives from class CChartObject. |//+------------------------------------------------------------------+class CChartObjectEllipse : public CChartObject
{
public:
CChartObjectEllipse(void);
~CChartObjectEllipse(void);
//--- method of creating the objectbool Create(long chart_id,conststring name,constint window,
constdatetime time1,constdouble price1,
constdatetime time2,constdouble price2,
constdatetime time3,constdouble price3);
//--- method of identifying the objectvirtualint Type(void) const { return(OBJ_ELLIPSE); }
};
//+------------------------------------------------------------------+//| Constructor |//+------------------------------------------------------------------+
CChartObjectEllipse::CChartObjectEllipse(void)
{
}
//+------------------------------------------------------------------+//| Destructor |//+------------------------------------------------------------------+
CChartObjectEllipse::~CChartObjectEllipse(void)
{
}
//+------------------------------------------------------------------+//| Create object "Ellipse" |//+------------------------------------------------------------------+bool CChartObjectEllipse::Create(long chart_id,conststring name,constint window,
constdatetime time1,constdouble price1,
constdatetime time2,constdouble price2,
constdatetime time3,constdouble price3)
{
if(!ObjectCreate(chart_id,name,OBJ_ELLIPSE,window,time1,price1,time2,price2,time3,price3))
return(false);
if(!Attach(chart_id,name,window,3))
return(false);
//--- successfulreturn(true);
}
//+------------------------------------------------------------------+
You must be adding an indicator/EA/script to your chart to draw these rectangles that you are having problems with... we need to see the contents of that.
We have no idea what that is called I'm afraid. I also suspect that the file won't use that include file... but we will see!
But post up more of your code where you actually call this to create your rectangle.
Don't know what just happened to my previous post (was about CChartObject::Fill(const bool new_fill) ...)
But post up more of your code where you actually call this to create your rectangle.
Sure, here it is:
I think you misunderstand me... this is an include file.
Somewhere else you will be actually calling this stuff to create things... e.g. rect
You'll be wanting to use something like rect.Fill(true)
I think you misunderstand me... this is an include file.
Somewhere else you will be actually calling this stuff to create things... e.g. rect
You'll be wanting to use something like rect.Fill(true)
Please edit your post and use the SRC-button for your code!
You need to help us to help you. This is a standard include file.
We need to see your indicator/EA where this stuff is actually used.
We are only seeing part of the picture... and not the correct bit!
You need to help us to help you. This is a standard include file.
We need to see your indicator/EA where this stuff is actually used.
We are only seeing part of the picture... and not the correct bit!
You must be adding an indicator/EA/script to your chart to draw these rectangles that you are having problems with... we need to see the contents of that.
We have no idea what that is called I'm afraid. I also suspect that the file won't use that include file... but we will see!
This is all i see...