- Scripts are also bound to the Chart, just like Indicators and Expert Advisors.
- If you exit or return from your Script, then all and every Class Object will be removed via the destructor method, and that includes the "CAppDialog" objects.
- You say you are following the tutorial, but the tutorial mentions Indicators and Expert Advisors for a reason, because Scripts can't handle the "OnChartEvent()" event handler, which is needed for the handling of events for the "CAppDialog" object.
Thank you for help, Fernando Carreiro. Your help is appreciable and valuable to me. Yet, I would like to comments some points...
1. Consider this quote: "Service is a program that, unlike indicators, Expert Advisors and scripts, does not require to be bound to a chart to work.". This is the point I want to reach out!
2. Like I supposed :-)
3. Ok... Scripts only work in OnStart event. In the snippet, I didn't add the OnChartEvent "commands" from the tutorial. I've just instantiate a object window, created a window and let it running... and this didn't work as expected. Worse, MetaTrader5 has frozen sometimes!
But, according you've wrote, I can create windows, panels and other friendly user interface elements via script, right? I wil keep trying. Muito obrigado pela tua ajuda!
Scripts and Services are two different things. Script is bound to Chart and Service is not bound to anything.
However, both of them can't handle Chart Events (ie. OnChartEvent()" event handler does not work on them).
Also, since a "service" is not bound to any Chart, where would the "CAppDialog" appear then?
As far as I know all the standard library panels and dialogs need to be bound to a chart. This is because they are created with Graphic Chart Objects.
- www.mql5.com
Scripts and Services are two different things. Script is bound to Chart and Service is not bound to anything.
However, both of them can't handle Chart Events (ie. OnChartEvent()" event handler does not work on them).
Also, since a "service" is not bound to any Chart, where would the "CAppDialog" appear then?
As far as I know all the standard library panels and dialogs need to be bound to a chart. This is because they are created with Graphic Chart Objects.
Ok... I was expecting to be able to create and work on a separated window. This isn't possible, isn't it?
Thank you for you helping!
Much like Windows Service, that runs in the background processing data but not actually interacting with the user, here too a MetaTrader 5 Service is for processing data without interacting with the user or displaying visual information.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
I would like to write a service (not a expert advisor or something bound to a chart) that uses a AppDialog class. Is there some limitation on using windows and panels objects in services? I was trying to adapt this tutorial putting all I can on OnStart function (as you can see in the snippet below), but I wasn't able to reach to any result. Sometimes MT5 freezes. What do I need to do to create a window in a mql service? I wasn't able to use printf propely too.