Download MetaTrader 5

CAppDialog in Expert Advisors - terminal freezing after closing

To add comments, please log in or register
Vitovd5
23
Vitovd5 2014.05.01 16:47 

Hello,

I tried to use new panel/controls interface in MetaTrader. I took SimplePanel.mq4+PanelDialog.mqh from Indicators\Examples directory, put them into one file SimplePanelEA.mq4, moved to Experts directory and I removed OnCalculate function and "#property indicator_*" lines. After attaching to a chart my new file SimplePanelEA works fine, but the problem is with closing. Only if I close using "X" in the upper right corner of the panel everything is fine. But if I try to close a chart or whole terminal then the terminal freezes. Sometimes I can have in logs information that the expert was closed by timeout.

So my questions is: should new controls be used differently in Expert Advisors than in Indicators? If so, what should be changed in attached code? Or is it a problem (bug) in MetaTrader 4? The same code in MetaTrader 5 (file renamed to SimplePanelEA.mq5) doesn't cause any troubles during closing.

Best regards
Vitovd

Files:
Alain Verleyen
Moderator
31134
Alain Verleyen 2014.05.01 22:45  
Vitor Hervatin
290
Vitor Hervatin 2017.01.12 02:44  
Vitovd5:

Hello,

I tried to use new panel/controls interface in MetaTrader. I took SimplePanel.mq4+PanelDialog.mqh from Indicators\Examples directory, put them into one file SimplePanelEA.mq4, moved to Experts directory and I removed OnCalculate function and "#property indicator_*" lines. After attaching to a chart my new file SimplePanelEA works fine, but the problem is with closing. Only if I close using "X" in the upper right corner of the panel everything is fine. But if I try to close a chart or whole terminal then the terminal freezes. Sometimes I can have in logs information that the expert was closed by timeout.

So my questions is: should new controls be used differently in Expert Advisors than in Indicators? If so, what should be changed in attached code? Or is it a problem (bug) in MetaTrader 4? The same code in MetaTrader 5 (file renamed to SimplePanelEA.mq5) doesn't cause any troubles during closing.

Best regards
Vitovd

Hi!

Is it works foi you? My problem with this is when a change the TF more then two times!

Can you help me? 

whroeder1
14753
whroeder1 2017.01.12 02:54  
Vitovd5: But if I try to close a chart or whole terminal then the terminal freezes. Sometimes I can have in logs information that the expert was closed by timeout.
  1. Indicators must return in a reasonable time because until they do, the terminal is hung. (Indicators can not sleep, trade or any other blocking calls.)
  2. EA must return within 3 seconds when the chart/terminal is shutdown or they will be forcefully terminated.
  3. Why is your expert taking so long to process a tick?
Vitor Hervatin
290
Vitor Hervatin 2017.01.12 03:18  

Please, look the error when I change the TF some times!

Files:
Fernando Carreiro
2290
Fernando Carreiro 2017.01.12 03:30  
Vitor Hervatin: Please, look the error when I change the TF some times!

English: If you have difficulty with the English language, consider using the Portuguese forum!

Português: Se tiver dificuldades com a língua Inglesa, considere utilizar o fórum em Português!

To add comments, please log in or register