Download MetaTrader 5

OBJ_HLINE Style/Color Set by USER

To add comments, please log in or register
aminlv
96
aminlv  

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
6784
Carl Schreiber  

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
2239
Fernando Carreiro  
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
96
aminlv  
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
96
aminlv  
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
2239
Fernando Carreiro  
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
15019
whroeder1  
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
96
aminlv  
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
2239
Fernando Carreiro  
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