Create a rectangle with 2 clicks - page 2

 
Lorentzos Roussos #:

It is , but , he controls the process :) 

You mean what is the purpose since the x axis is only per bar and not "flexible" ?

Sorry! I don’t understand your question… my question was, how can take the xy values for two consecutive mouse clicks on the chart… presently I am doing that by counting the clicks … if click==1 ( do that…) if click==2 ( do that..) Any other way to take the parameters of two consecutive mouse chart clicks? And clicks I am counting them like … if (id == CHARTEVENT_click)count++ ;
 
Daniel Cioca #:
Sorry! I don’t understand your question… my question was, how can take the xy values for two consecutive mouse clicks on the chart… presently I am doing that by counting the clicks … if click==1 ( do that…) if click==2 ( do that..) Any other way to take the parameters of two consecutive mouse chart clicks? And clicks I am counting them like … if (id == CHARTEVENT_click)count++ ;

If you don't get both clicks at the same time , if it works , then its okay i guess . You just cant draw the rectangle live unless you also track mousemove

 
Lorentzos Roussos #:

If you don't get both clicks at the same time , if it works , then its okay i guess . You just cant draw the rectangle live unless you also track mousemove

Like this

Files:
 
Daniel Cioca #:

Like this

Very nice  ,well done. What if you click the bar and it automatically gets the top and bottom ?

 
Lorentzos Roussos #:

Sí , en lugar de ocultar y mostrar que usted puede modificar el color y el estado .

He marcado donde los cambios .

Ugh! I thought it was just including a ChartSetInteger or similar, I see that two voids have to be created.
Thank you.
 
Daniel Cioca #:

Como este

Hello Daniel!
Thank you for your appreciation, but as Lorentzos comments, the idea of this rectangle is to draw it with random points, not on a sail, so that later with this rectangle, which is nothing more than a zone or work area, carry out an analysis internally in this zone or area. specific.
Thank you.

 
Manuel De Los Heros Soler #:

Hello Daniel!
Thank you for your appreciation, but as Lorentzos comments, the idea of this rectangle is to draw it with random points, not on a sail, so that later with this rectangle, which is nothing more than a zone or work area, carry out an analysis internally in this zone or area. specific.
Thank you.

The thread title is “ two clicks” … that’s why I mentioned it … a rectangle with two clicks … you can choose what these clicks will define… the entire rectangle, and then the clicks will define the prices and the starting time, the end time will be current time, or you can choose that second click can be price No2 and time No2, and you can place the rectangle wherever you like. About the Lorentzo code , is very good and much to learn from , but there is no diference with the rectangle already provided in the mt4 platform… why coding another object when is already there … 😁
 

It's true it already exists .

But its fun 

And the alternative would be to tell the user : 

  • "Add a rectangle for Zone1."
  • "Use the button on the toolbox"
  • "if the toolbox not visible go to view...."
  • "if you decide not to draw zone 1 , click the button again" (because his utility is expecting a rectangle for zone1 , if the user does not inform he canceled , the ea is stuck)

😊 😇 😊