Download MetaTrader 5
To add comments, please log in or register
Launch your trading signal and add account monitoring!
aminlv
91
aminlv 2016.07.07 09:05 

hi guys,

got dilemma with Line, seems fail to fix it  
i appreciate any insight on this

i can change color of line if i put it on extern section but its not very good way to change it i like to change as common style set em i mean this

H_Line Styles

but i don't know how when user for exam chose a color or different pattern grab and change the line with this new settings

 

i appreciate any insight on this guys thank you in advance 

Carl Schreiber
5927
Carl Schreiber 2016.07.07 09:31  

This window is available due to this part of an indicator:

#property  indicator_buffers 2
#property indicator_color1  clrSkyBlue
#property indicator_color2  clrMagenta
Fernando Carreiro
1429
Fernando Carreiro 2016.07.07 09:32  
Unfortunately, there is no "programmatic" way (at least in pure MQL) to know what the user has selected or changed in the default "Colors" panel of an Indicator.
aminlv
91
aminlv 2016.07.07 11:10  
gooly:

This window is available due to this part of an indicator:


yup thats how i show it on, however when i change color or style it doesn't applies to my line!
aminlv
91
aminlv 2016.07.07 11:18  
FMIC:
Unfortunately, there is no "programmatic" way (at least in pure MQL) to know what the user has selected or changed in the default "Colors" panel of an Indicator.

seriously? o.O so why they even put it there lol

 i was really looking to make my indicator bit better this way i guess back to normal extern settings -_- 

Fernando Carreiro
1429
Fernando Carreiro 2016.07.07 12:12  
amin:

seriously? o.O so why they even put it there lol

 i was really looking to make my indicator bit better this way i guess back to normal extern settings -_- 

Seriously??? They put it there, so that the users can change the visual appearance of the indicator, obviously! However, you cannot "programmatically" know if the user chose Orange or Blue, or Thick or Thin, or Solid or Dotted, etc.

You can however, set "extern" or "input" parameters for them and have the user change them from the input parameters, and in this way you will "know" what the user choice is.

whroeder1
13592
whroeder1 2016.07.07 17:08  
Don't use the properties
#property  indicator_buffers 2
#property indicator_color1  clrSkyBlue
#property indicator_color2  clrMagenta
Use inputs
#property  indicator_buffers 2
input color indicator_color1 = clrSkyBlue;
input color indicator_color2 = clrMagenta;
int Oninit(){
   SetIndexStyle(0, DRAW_LINE, EMPTY, EMPTY , indicator_color1);
   SetIndexStyle(1, DRAW_LINE, EMPTY, EMPTY , indicator_color2);
aminlv
91
aminlv 2016.07.08 11:42  
WHRoeder:
Don't use the properties
Use inputs

Thank you, i added your code however seems it missing something it draw nothing, i thought its black line or something but there was no line in mt4 object list wondering whats going on
Fernando Carreiro
1429
Fernando Carreiro 2016.07.08 11:53  
amin:
Thank you, i added your code however seems it missing something it draw nothing, i thought its black line or something but there was no line in mt4 object list wondering whats going on

WHRoeder only gave you sample code for you to build on. It is up to you to implement and use all of the properties that you wish to use, such as Shape StyleDrawing Style, Line Width, Colour, Arrows, etc.

Read the documentation on all the various functions for a Custom Indicator: https://docs.mql4.com/customind

/
To add comments, please log in or register