Change color on a MA indicator

 

I am trying to write a MA indicator that change color when it change from going up to down and vice versa. I have tried to use SetIndexStyle but that change all of the indicator color. Can someone help me with this?

 

You have to use two indicator indexes to get mixed color on a line/histogram

Awesome.mq4 is an example in your Custom Indicator list

 
Thanks for the feedback.  I got it working.