OBJ_HLINE Style/Color Set by USER

Back to topics list To post a new topic, please log in or register
avatar
22
amin 2016.07.07 11: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 

 

 

 

 

avatar
2017
gooly 2016.07.07 11:31 #
 

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

#property  indicator_buffers 2
#property indicator_color1  clrSkyBlue
#property indicator_color2  clrMagenta


avatar
1200
FMIC 2016.07.07 11: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.
avatar
22
amin 2016.07.07 13: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!
avatar
22
amin 2016.07.07 13: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 -_- 

avatar
1200
FMIC 2016.07.07 14: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.

avatar
12985
WHRoeder 2016.07.07 19: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);

avatar
22
amin 2016.07.08 13: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
avatar
1200
FMIC 2016.07.08 13: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

Back to topics list  

To add comments, please log in or register