Download MetaTrader 5
To add comments, please log in or register
MQL5 Reference is available in 8 languages. Learn MQL5 in the language that suits you best!
Dasio1986
531
Dasio1986 2014.10.31 10:05 

Hi,

i have problem with OnChartEvent specially with CHARTEVENT_OBJECT_CLICK.

For me it's strage what happen.

With an indicator a create 3 different button in separate window. If i load the indicator for the first time the Function  CHARTEVENT_OBJECT_CLICK work perfectly with it but :

If i change TF of the chart where is loaded the Indicator loaded on the chart the Function CHARTEVENT_OBJECT_CLICK don't work whit these 3 button.

If i load another Symbol on the chart where is loaded the indicator the Function CHARTEVENT_OBJECT_CLICK don't work whit these 3 button.

 I use the &sparam costant for the OnChartEvent and CHARTEVENT_OBJECT_CLICK.

Sorry for my English.

Someone can help me? 

honest_knave
969
honest_knave 2014.10.31 10:30  

Do any other chart objects overlap the buttons? Try changing the z-order of your buttons:

 

OBJPROP_ZORDER

Priority of a graphical object for receiving events of clicking on a chart (CHARTEVENT_CLICK). The default zero value is set when creating an object; the priority can be increased if necessary. When applying objects one over another, only one of them with the highest priority will receive the CHARTEVENT_CLICK event.

long

Dasio1986
531
Dasio1986 2014.10.31 10:35  
honest_knave:

Do any other chart objects overlap the buttons? Try changing the z-order of your buttons:

 

OBJPROP_ZORDER

Priority of a graphical object for receiving events of clicking on a chart (CHARTEVENT_CLICK). The default zero value is set when creating an object; the priority can be increased if necessary. When applying objects one over another, only one of them with the highest priority will receive the CHARTEVENT_CLICK event.

long

 

Hi, thank you for the reply. There aren't other object that overlap the buttons also because there are other buttons, create from the same indicator and with the same funtion, that work perfecly also if i change tf or symbol. The problem there is only with the 3 buttons.
Dasio1986
531
Dasio1986 2014.10.31 10:39  
Sorry i found the error. I did a mistake in deinit when delete theese 3 buttons. Now i delete correctly the 3 button and it work perfectly
honest_knave
969
honest_knave 2014.10.31 10:41  
I'm glad you got it sorted
/
To add comments, please log in or register