I wrote the following code to get the indexes from the LSMA indicator on the current bar:
index0=iCustom(NULL,0,"LSMA in Color",34,1500,0,0);
index1=iCustom(NULL,0,"LSMA in Color",34,1500,1,0);
index2=iCustom(NULL,0,"LSMA in Color",34,1500,2,0);
but it always give me the same value for
how I can recognize the color of the indicator on the current bar ?
index0 1 2 are int ;-0
Thanks in advance for your support
I tried to declare index0 1 2 as double i.s.o integer, but they give always the same value.
Thus I can't distinguish which color is it .
Please HELP !
Please somebody help me . May be Phy ?
Your indicator has three indexes, for three colors.
Figure out which index corresponds to which color,
and when that index has a value in it which is near price for that bar,
that is your clue to the color.
Your index0/1/2 need to be type double.
You need to verify that your iCustom call is correctly formatted.
What you are doing "looks" ok, but you don't show all your code, so who knows.
thanks for your support.
Hereafter it's my code:
LSMA_index0=iCustom(NULL,0,"LSMA in Color",34,1500,0,0);
LSMA_index1=iCustom(NULL,0,"LSMA in Color",34,1500,1,0);
LSMA_index2=iCustom(NULL,0,"LSMA in Color",34,1500,2,0);
if(LSMA_index0 != LSMA_index1 || LSMA_index1!=LSMA_index2 || LSMA_index0!=LSMA_index2)
sComment=sComment+"LSMA color0=" +LSMA_index0+"\n";
sComment=sComment+"LSMA color1=" +LSMA_index1+"\n";
sComment=sComment+"LSMA color2=" +LSMA_index2+"\n";
sComment=sComment+"Difference found=" +difference_found+"\n";
but it never set difference_found = true ;-(
The value of LSMA_index0, LSMA_index1, LSMA_index2 are always the same . Like this I never can find out which color is it.
Once I could clear identify a color changing I would like to write an EA that buy when color changed from red->green or from yellow -> green and sell when the opposite occurs.
Can you please HELP me ?
Thanks in advance
Why don't you just post your code, Why make us guess?
Also, you posted a different indicator than what you are calling in your snips.
here is my code ;-)
Sorry, you are right . I attch hereafter the indicator that i call
Please enable the necessary setting in your browser, otherwise you will not be able to log in.