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
If literally on a rectangular object, then no.
The canvas is also an object.
You can only "transform" a canvas object into a rectangle object by programming its contents to move and scale.
Visually, it can look exactly like a rectangular object with small squares in the corners to control it. But only a few programmers in this community will be able to implement this, including me.
If we are talking about the transformation of the internal contents of the rectangle. If we are talking about a simple filled or empty rectangle, any programmer can do it.
Ok Nikolai, understood. Thank you very much!
Ok Nikolai, understood. Thank you very much!
No problem.
The latest version is 1.47 here: https://www.mql5.com/ru/code/22164
If you are interested in this topic, I would recommend you to see this Russian speaking thread with Google Translate:
https://www.mql5.com/ru/forum/227736
Good day, colleagues!
Why doesn't the code below work for me? For example, I wanted to draw circles over bars that have certain conditions.
void OnTimer()
{
Canvas.Erase(0x00FFFFFF);
for(int i = 0; i < 100 ; i++)
{
if(iClose(_Symbol, PERIOD_CURRENT, i + 1) > iClose(_Symbol, PERIOD_CURRENT, i + 2))
{
Canvas.Circle((int)_X(Canvas.Bar(i + 1)), (int)_Y(Canvas.Price(iClose(_Symbol, PERIOD_CURRENT, i + 1))), 5, 0x88ff9999);
}
}
Canvas.Update();
}
Good time, colleagues!
Why doesn't the code below work for me? For example, I wanted to draw circles over bars that have certain conditions.
void OnTimer()
{
Canvas.Erase(0x00FFFFFF);
for(int i = 0; i < 100 ; i++)
{
if(iClose(_Symbol, PERIOD_CURRENT, i + 1) > iClose(_Symbol, PERIOD_CURRENT, i + 2))
{
Canvas.Circle((int)_X(Canvas.Bar(i + 1)), (int)_Y(Canvas.Price(iClose(_Symbol, PERIOD_CURRENT, i + 1))), 5, 0x88ff9999);
}
}
Canvas.Update();
}
Good time, colleagues!
Why doesn't the code below work for me? For example, I wanted to draw circles over bars that have certain conditions.
I got to my computer:
got to the computer:
Cheers Nikolai!
Thank you.
Is there an implementation of how to place text with adhesion?
An analogue of Align or something. Or at least a function that gets the size of the text block.
Is there an implementation of how to place text with adherence?
An analogue of Align or something. Or at least a function that gets the size of the text block.
https://www.mql5.com/en/docs/standardlibrary/canvasgraphics/ccanvas/ccanvastextsize
https://www.mql5.com/en/docs/standardlibrary/canvasgraphics/ccanvas/ccanvastextout
https://www.mql5.com/en/docs/standardlibrary/canvasgraphics/ccanvas/ccanvastextsize
https://www.mql5.com/en/docs/standardlibrary/canvasgraphics/ccanvas/ccanvastextout
Nicholas, are there any developments or examples of interaction with interface elements written in Canvas?
For example, there are two buttons Canvas.Rectangle.
How to check if one of them is clicked except for the option of checking mouse and button coordinates?
Nikolay, are there any developments or examples of interaction with interface elements written in Canva?
For example, there are two buttons Canvas.Rectangle.
How to check if one of them is clicked except for the option of checking mouse and button coordinates?