Download MetaTrader 5

how to have the color of last dot of <magic dot indicator>???

To add comments, please log in or register
How to buy a product in MetaTrader AppStore? Read the article!
mohammadsk313
38
mohammadsk313 2016.11.10 07:44 

Hi to all

My main problem is ==> i don't have the color of last dot in magic dot indicator with (iCustom function)!!

double s = iCustom(Symbol(),0, "Magic dots 2 mtf alerts", 0 ,MODE_EMA ,6 , 0 , PRICE_CLOSE , false,false,true,false,false,false);

I Commented (s) and the out puts doesn't mach with color!!! 

please answer !!

Carl Schreiber
6590
Carl Schreiber 2016.11.10 08:02  

It seems that the last two parameters of iCustom were not entered as they are the buffer-number and the shift - they can't be boolean!

Read about iCustom() (Mark it in the editor and press F1).

mohammadsk313
38
mohammadsk313 2016.11.10 08:19  
Carl Schreiber:

It seems that the last two parameters of iCustom were not entered as they are the buffer-number and the shift - they can't be boolean!

Read about iCustom() (Mark it in the editor and press F1).

Tanq

you mean i must write :

double s = iCustom(Symbol(),0, "Magic dots 2 mtf alerts", 0 ,MODE_EMA ,6 , 0 , PRICE_CLOSE , false,false,true,false,false,false0,0);

Carl Schreiber
6590
Carl Schreiber 2016.11.10 08:51  
mohammadsk313:

Tanq

you mean i must write :

double s = iCustom(Symbol(),0, "Magic dots 2 mtf alerts", 0 ,MODE_EMA ,6 , 0 , PRICE_CLOSE , false,false,true,false,false,false0,0);

1) A ',' seems to be missing: "..false0,0);"

2) As I don't know your indicator and its parameters it might work (with the ',') but it is not sure!

3) Finally I don't know whether the buffer 0 is the one you need!

mohammadsk313
38
mohammadsk313 2016.11.10 09:22  
Carl Schreiber:

1) A ',' seems to be missing: "..false0,0);"

2) As I don't know your indicator and its parameters it might work (with the ',') but it is not sure!

3) Finally I don't know whether the buffer 0 is the one you need!

thanq

',' was a bug . it wasn't important anyway thanq(:

eevviill6
27
eevviill6 2016.11.10 12:03  
mohammadsk313:

Hi to all

My main problem is ==> i don't have the color of last dot in magic dot indicator with (iCustom function)!!

double s = iCustom(Symbol(),0, "Magic dots 2 mtf alerts", 0 ,MODE_EMA ,6 , 0 , PRICE_CLOSE , false,false,true,false,false,false);

I Commented (s) and the out puts doesn't mach with color!!! 

please answer !!

 

double last_dot_price;

double data;

for(int i=0;i<Bars-20;i++)

{

data=iCustom(...,i);

if(data!=EMPTY_VALUE)

{

last_dot_price=data;

break;

}

}
whroeder1
14510
whroeder1 2016.11.10 14:01  
mohammadsk313: i don't have the color of last dot in magic dot indicator with (iCustom function)!!
  1. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
  2. Color means it uses two or more buffers. You have a color when the value is not EMPTY_VALUE.
  3. You must loop backwards until you find a buffer with a value. Then you'll know the color based on which buffer has the value.
To add comments, please log in or register