Get Color Of customer indicator ?

 

Hi,

Example I have a colorHMAMA, which have green for trend up, red for trend down, and yellow for flat, i would like to use this color to confirm in ea, how can i check the color?


Im able to check the value by using:


double HMAValue = iCustom(NULL,0,"colorHMAMA",24,0,3,1,2,0,0, candle1);


i have no idea how to check the get the color from that custom MA.


Can any one give me some tips..


Thank you.

 

Hello yster

do you have indicator source code?

if so then some 'maybe' ideas, you could do for example:

1. add extra index buffer which contains for each bar/element the color value or eg, 1=up, 0=flat, -1=down

2. create named object which contains value. The name is also known by EA so can 'get at' object's value. Maybe value is 'current' or 'ongoing' trend type.

3. create named Terminal global variable with value similar to (2) above.

4. create file which indicator writes current value... May need single access guard semaphore such that EA can only read when indicator allows.

5. ?

Regards

 
You could post it if you wouldn't mind. Would amke it easier to understand how it draws its colors to then determine how to transfer them to your ea.
 

See your source code, should have three buffer in it to draw in those three color, one for one. So

iCustom(NULL,0,"colorHMAMA",24,0,3,1,2,0,0, candle1); //0,

iCustom(NULL,0,"colorHMAMA",24,0,3,1,2,0,1, candle1); //1,

iCustom(NULL,0,"colorHMAMA",24,0,3,1,2,0,2, candle1); // 2,

 

Hi Yster

The question you want the answer to is :-

What direction is the indicator indicating?


The colour is telling you which of three indicator lines is at the current price so read all the values and two will contain a big number that is taken to be the empty line value and one will have the current price. A common check used is if(line<10000) then it is a valid price.

Reason: