Download MetaTrader 5

Is it possible to draw buttons on chart with the new MT4 update

To add comments, please log in or register
Do you know that MQL5 is an object-oriented language?
Tradeing Trader
556
Tradeing Trader 2014.02.06 12:14 
Hello, is it now possible to draw buttons on chart wich can be use for trading with the new MQL4 update?
Simon Gniadkowski
Moderator
18000
Simon Gniadkowski 2014.02.06 17:08  
PlanandTrade:
Hello, is it now possible to draw buttons on chart wich can be use for trading with the new MQL4 update?
Try it and find out . . .
Alain Verleyen
Moderator
30727
Alain Verleyen 2014.02.06 17:56  
PlanandTrade:
Hello, is it now possible to draw buttons on chart wich can be use for trading with the new MQL4 update?
Yes it's possible but only with mql4 code, not directly with MT4. See help file (F1).
Tradeing Trader
556
Tradeing Trader 2014.02.09 10:34  
angevoyageur:
Yes it's possible but only with mql4 code, not directly with MT4. See help file (F1).


Wich functions must be use to make that?
Simon Gniadkowski
Moderator
18000
Simon Gniadkowski 2014.02.09 10:37  
PlanandTrade:

Wich functions must be use to make that?

ObjectCreate

The function creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow of the specified chart. There are two variants of the function:


OBJ_LABEL

Label

OBJ_BUTTON

Button

OBJ_BITMAP

Bitmap


OBJ_BUTTON

Button object.


Note

Anchor point coordinates are set in pixels. You can select button anchoring corner from ENUM_BASE_CORNER.

Example

The following script creates and moves Button object on the chart. Special functions have been developed to create and change graphical object's properties. You can use these functions "as is" in your own applications.


Tradeing Trader
556
Tradeing Trader 2014.02.09 21:52  

I did use now a example for draw the buttonfrom the MQL4 Reference book.

I am asking now myself how i can get a info in the code abouth a click on the button, wich functions must be use to receive a button click?

Simon Gniadkowski
Moderator
18000
Simon Gniadkowski 2014.02.09 23:39  
PlanandTrade:

I did use now a example for draw the buttonfrom the MQL4 Reference book.

I am asking now myself how i can get a info in the code abouth a click on the button, wich functions must be use to receive a button click?

You use OnChartEvent() and CHARTEVENT_OBJECT_CLICK
Tradeing Trader
556
Tradeing Trader 2014.02.10 11:16  

Can you give a code example, for me as mql4 coder this new codes looks strange.

i have a button now on my chart...but i dont find easy to understand exampels for using OnChartEvent() function.

Simon Gniadkowski
Moderator
18000
Simon Gniadkowski 2014.02.10 11:30  
PlanandTrade:

Can you give a code example, for me as mql4 coder this new codes looks strange.

i have a button now on my chart...but i dont find easy to understand exampels for using OnChartEvent() function.

No I can't . . . spend some time, figure it out then post your code to help others . . .
SemperAugustus
20
SemperAugustus 2014.02.10 12:34  

The button is an interesting object, but it was not an answer to my question.

What i need is the time of the most left candle that is actually visible.

Simon Gniadkowski
Moderator
18000
Simon Gniadkowski 2014.02.10 12:36  
SemperAugustus:

The button is an interesting object, but it was not an answer to my question.

What i need is the time of the most left candle that is actually visible.

OK, but this thread is about "Is it possible to draw buttons on chart with the new MT4 update" . . .
12
To add comments, please log in or register