How to write a Octagon Polygon using canvas in mq4?

 

Canvas Polygon Octagon  

 Hello !!!!

This is an example how could look like a dynamic polygon using canvas in mql4..

Could somebody guide me..or show me an example of script to do it? 

 I dint not find any help how to doing.. the values from EUR, USD,GBP., etc are dynamic and coming from an indicator.  (in total summatory its 100) , but would ve very interesting if we can draw the "octagon" shape in the matatrader... thank you!

 
  • An 8-sided irregular polygon is NOT an octogon.
  • The total is 99, not 100.
  • The problem is not canvas, you firstly need an algorithm.
  • Once you have it you just need to draw 8 lines.
 
  • An 8-sided irregular polygon is NOT an octogon. 

 

??. https://en.wikipedia.org/wiki/Octagon  ?

 

  • The total is 99, not 100.

well information is dynamic.. this just a printed example.

 

  • The problem is not canvas, you firstly need an algorithm.

Well--Yes..Now i see.. too hard do it with canvas D:  ( dynamic polygon shape from information.

 

rhis works OK.. but..  Fill cycles. :D

 

  canvas.FillCircle(200,180,lolCAD,ColorToARGB(Green));

      canvas.FillCircle(200,200,lolGBP,ColorToARGB(Red));

      canvas.FillCircle(200,220,lolUSD,ColorToARGB(Yellow));

      canvas.FillCircle(200,240,lolJPY,ColorToARGB(Blue));

      canvas.FillCircle(200,260,lolCHF,ColorToARGB(Orange)); 

 

 

 

 

 

 

Octagon - Wikipedia
Octagon - Wikipedia
  • en.wikipedia.org
Regular octagon Type Edges and vertices Schläfli symbol Coxeter diagram Symmetry group Internal angle (degrees) Dual polygon Properties In geometry, an octagon (from the Greek ὀκτάγωνον oktágōnon, "eight angles") is an eight-sided polygon or 8-gon. The sum of all the internal angles of any octagon is 1080°. As with all polygons, the...
 
Robert Petters:
  • An 8-sided irregular polygon is NOT an octagon. 

 

??. https://en.wikipedia.org/wiki/Octagon  ?

Not very important but I wrote : An 8-sided irregular polygon is NOT an octagon.

An octagon is a regular 8-sided polygon ;-)

 

  • The total is 99, not 100.

well information is dynamic.. this just a printed example.

It's most probably a rounding issue.


 

  • The problem is not canvas, you firstly need an algorithm.

Well--Yes..Now i see.. too hard do it with canvas D:  ( dynamic polygon shape from information.


rhis works OK.. but..  Fill cycles. :D

 

  canvas.FillCircle(200,180,lolCAD,ColorToARGB(Green));

      canvas.FillCircle(200,200,lolGBP,ColorToARGB(Red));

      canvas.FillCircle(200,220,lolUSD,ColorToARGB(Yellow));

      canvas.FillCircle(200,240,lolJPY,ColorToARGB(Blue));

      canvas.FillCircle(200,260,lolCHF,ColorToARGB(Orange)); 

 

It's no more a polygon nor an octagon
 

yes.,.. I undertand now.. too hard doing with canvas alternative :D  .. thank you ..Alain!!  .. about circle.. Im just was testing the canvas use... :D

--- So.. do you know another alternative.. instead Canvas..  or.. how to do a dynamic.. Stat Cake.. or.. FILL a bar?    where.. full bar its 100 and the little bars are parameters from lolEUR, lolCAD, etc

 

_______________ __________ ___________ ___ ______ _____________ ______ _______________________ 

 
Robert Petters:

yes.,.. I undertand now.. too hard doing with canvas alternative :D  .. thank you ..Alain!!  .. about circle.. Im just was testing the canvas use... :D

--- So.. do you know another alternative.. instead Canvas..  or.. how to do a dynamic.. Stat Cake.. or.. FILL a bar?    where.. full bar its 100 and the little bars are parameters from lolEUR, lolCAD, etc

 

_______________ __________ ___________ ___ ______ _____________ ______ _______________________ 

There is plenty of possibilities to draw on a chart, but in all cases you will to decide what (circles ? bars ? polygon ?...) you want to draw before to see how (canvas, indicator's buffers, objects...) you want to draw it.