Can we create custom property windows for indicators?

 

When you double click on an indicator or drag and drop it on a chart, a property window pops up.I am wondering if we can design a custom property window other than the default one that the metatrader provides. 

For example, we may be inclined to remove or add some window tabs, or we may want to have some special tick boxes in the property window.

If the answer is "YES", could you kindly give some blue prints on the steps that a programmer should follow for this purpose. Please also mention that if your solution works in MQL4 or MQL5.

 
Hosein Rahnama:

When you double click on an indicator or drag and drop it on a chart, a property window pops up.I am wondering if we can design a custom property window other than the default one that the metatrader provides. 

For example, we may be inclined to remove some of the unused tabs of this window in the default version, or we may want to have some special tick boxes in the property window.

If the answer is "YES", could you kindly give some blue prints on the steps that a programmer should follow for this purpose. Please also mention that if your solution works in MQL4 or MQL5.

 
Fernando Carreiro:

Ooops! Is it the same for the expert advisors?

 
Hosein Rahnama: Ooops! Is it the same for the expert advisors?

Obviously!

 
Fernando Carreiro:

Obviously!

I just came across this nice topic, which is some how related to my question. In the comments section, Alain Verleyen suggests using Windows Messaging API. Have you tried this before?

Is it possible to disable the Parameters tab ?
Is it possible to disable the Parameters tab ?
  • 2013.03.06
  • www.mql5.com
I'm currently working on a few non-technical indicators and don't need some of the tabs that pop up when I select the properties of my Indicators...
 
Hosein Rahnama: I just came across this nice topic, which is some how related to my question. In the comments section, Alain Verleyen suggests using Windows Messaging API. Have you tried this before?

No, it will not work, because it requires that you have an "outside" process carrying out the WinAPI manipulation on the properties dialog box.

When you place an Indicator or EA on the chart, none of your code is actually executed until the dialog box is accepted, so there is no way for the code in that indicator or EA to manipulate its own opening dialog box of properties.

Only an outside process could do that. Hence, it is not a possible for the Indicator or EA to do it itself, and also a very impractical approach even with an outside process.

 
Fernando Carreiro:

No, it will not work, because it requires that you have an "outside" process carrying out the WinAPI manipulation on the properties dialog box.

When you place an Indicator or EA on the chart, none of your code is actually executed until the dialog box is accepted, so there is no way for the code in that indicator or EA to manipulate its own opening dialog box of properties.

Only an outside process could do that. Hence, it is not a possible for the Indicator or EA to do it itself, and also a very impractical approach even with an outside process.

One of my friends, @Yury Kulikov, told me that we can create custom property windows using these classesHe said, "On MQL5, you can make any GUI, even round, even animated. You can make a complete imitation of a standard window."

Furthermore, he kindly provided the following animation as an example. I think this is sufficient for our needs.


Documentation on MQL5: Standard Library / Panels and Dialogs
Documentation on MQL5: Standard Library / Panels and Dialogs
  • www.mql5.com
Panels and Dialogs - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Hosein Rahnama: One of my friends, @Yury Kulikov, told me that we can create custom property windows using these classesHe said, "On MQL5, you can make any GUI, even round, even animated. You can make a complete imitation of a standard window." Furthermore, he kindly provided the following animation as an example. I think this is sufficient for our needs.

That is just a normal graphics panel, that you can even create in MQL4. However, that appears after the default "Properties" dialog-box presented by MetaTrader, when you initially attach it to a chart. You will not be able to substitute the default one.

 
Fernando Carreiro:

That is just a normal graphics panel, that you can even create in MQL4. However, that appears after the default "Properties" dialog-box presented by MetaTrader. You will not be able to substitute the default one.

Yes, you are right. But this one is also fine for most of our needs. After rethinking my question, I came to the conclusion that what I really need is a custom property window associated with an object or indicator. It really does not matter if this window is the default pop-up window or something like this that shows up after reselecting the object or indicator. I think that this needs a lot more work and effort to be implemented in MQL4 than MQL5. Doesn't it?

 
Hosein Rahnama: Yes, you are right. But this one is also fine for most of our needs. After rethinking my question, I came to the conclusion that what I really need is a custom property window associated with an object or indicator. It really does not matter if this window is the default pop-up window or something like this that shows up after reselecting the object or indicator. I think that this needs a lot more work and effort to be implemented in MQL4 than MQL5. Doesn't it?
I don't use MetaQuotes' Standard Library (I make my own), so I don't know what differences there are are between the MQL4 and MQL5 versions of the two libraries.
 
Fernando Carreiro:
I don't use MetaQuotes' Standard Library (I make my own), so I don't know what differences there are are between the MQL4 and MQL5 versions of the two libraries.

Have you seen this video, Fernando? It seems that even the the default properties dialog-box is modified there? Am I right?

Reason: