Download MetaTrader 5
To add comments, please log in or register
Store your source codes in MQL5 Storage. It is secure!
olle.onkel
50
olle.onkel 2014.06.18 20:47 

Hello,

I have a (maybe understanding) problem with indicators created from the classes provided by the standard library. I want to write a class including a mixture of custom an prefined indicators. In my case I´ve created an instance of the CiDeMarker class within the Oscilators. The class provides a lot os usefull methods, and the indicator can be added to the Chart with AddToChart(). So far, no problem.

Now I ask myself, how I can set the properties of this indicator, like I would do it when creating a "nomal" indicator. I would like to add 2 levels, change the color of the indicator drawing and would like to "design" the level lines to my desired shapes. How to do this? Normally, when creating a "normal" indicator, there are the IndicatorSetInteger(), ...SetDouble() ... and SetString() functions or some properties can be predefined with the #propertie directive. But how to do this with a class instance of an indicator? Furthermore, I also found no way yet, to set these properties with the "handle" obtained from the technical indicator funtions (iDeMarker() , in my case).

I´m pretty sure, that there is an easy solution for this problem, but so far, since 3 days I cannot find one. So, I please ask the community to give me a clue.

Thank you very much in advance.

Alain Verleyen
Moderator
28535
Alain Verleyen 2014.06.18 21:56  

As far as I understand what you want, it's not possible (except by modifying the source code of the indicator if available).

IndicatorSetInteger(), ...SetDouble() ... and SetString() functions or some properties can be predefined with the #propertie directive.

Can only be used inside an indicator.

Classes from the SL are to use indicator within an EA.

olle.onkel
50
olle.onkel 2014.06.19 09:50  
angevoyageur:

As far as I understand what you want, it's not possible (except by modifying the source code of the indicator if available).

Can only be used inside an indicator.

Classes from the SL are to use indicator within an EA.

Thank you very much for your reply! This helped me to save futher time.

As I understand, the indicator classes from the standard library are only for calculation and using the results within EA´s and classes. I thought, if there is a method to add them to a chart, there should also be an interface to access the drawing etc. properties. Thats why I spent so much time on finding them ;-(

So I have to predefine all my desired indicators in separate indicator files (indicator programs) and can instance them using the CiCustom class? Will all predefined properties (linestyle, color of plot etc.) be applied using "my indicator" as an instance of CiCustom or only the buffers? 


Regards,

olle.onkel

Alain Verleyen
Moderator
28535
Alain Verleyen 2014.06.19 10:26  
olle.onkel:

Thank you very much for your reply! This helped me to save futher time.

As I understand, the indicator classes from the standard library are only for calculation and using the results within EA´s and classes. I thought, if there is a method to add them to a chart, there should also be an interface to access the drawing etc. properties. Thats why I spent so much time on finding them ;-(

So I have to predefine all my desired indicators in separate indicator files (indicator programs) and can instance them using the CiCustom class? Will all predefined properties (linestyle, color of plot etc.) be applied using "my indicator" as an instance of CiCustom or only the buffers? 


Regards,

olle.onkel

Yes.
/
To add comments, please log in or register