I would like a RECTANGLE_LABEL on my chart.
But it comes me only a LABEL.
Where is the error?
Hi FinGeR,
Because you're using class to control text instead class to control object rectangle like ChartObjectsShapes.mqh.
If I confuse using classes, I'll go the 'old fashion' way, using ObjectCreate() function.
:D
thanks onewithzachy,
but CChartObjectRectLabel located in ChartObjectsTxtControls.mqh
thanks onewithzachy,
but CChartObjectRectLabel located in ChartObjectsTxtControls.mqh
Dear FinGeR,
My apology, you are right, obviously I didn't read your code carefully and didn't check the entire content of ChartObjectsTxtControls.mqh.
I'm a little busy at the moment and I just check my CChartObjectRectLabel return is true but no object.
:D
Hi,
You should pass rect sizes on create function:
#include <ChartObjects\ChartObjectsTxtControls.mqh> void OnStart() { CChartObjectRectLabel *m_anker; m_anker=new CChartObjectRectLabel; m_anker.Create(0,"Text",0,0,0, 50, 30); }
Because CChartObjectRectLabel is inherited from CChartObjectLabel, and both parent - child have same Create method. The way you call Create will run the parent's method instead of the child (which is create a label object).
- www.mql5.com
Hi,
You should pass rect sizes on create function:
Because CChartObjectRectLabel is inherited from CChartObjectLabel, and both parent - child have same Create method. The way you call Create will run the parent's method instead of the child (which is create a label object).
Now it works.
Thank you very much.
No problem :)
Hi,
You should pass rect sizes on create function:
Because CChartObjectRectLabel is inherited from CChartObjectLabel, and both parent - child have same Create method. The way you call Create will run the parent's method instead of the child (which is create a label object).
Hi meisme,
Thanks for that, LOL, I coded my code wrong, no wonder there is no object.
There's no sample in MT5 too.
:D
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I would like a RECTANGLE_LABEL on my chart.
But it comes me only a LABEL.
Where is the error?