Need Help attaching Indicator to simple EA

Hello all,
I am making my own simple EA that uses a Heikin-Ashi indicator i found on the net.I can call the indicator and see it on the chart but i cant figure out how to put in simple buy sell points using this indicator.

In my EA this how i call the variable:
double FX1 = iCustom(NULL,0, “Heiken_Ashi_Smoothed”,0, Current + 0);

These are the properties of the indicator:
//---- parameters
extern int MaMetod =1;
extern int MaPeriod=3;
extern int MaMetod2 =1;
extern int MaPeriod2=2;

on the chart it draws red and green candles according to price direction.I would like to know how i find out which part of the code to look for when
looking for the change from green to red and vice versa.Not sure how to explain it really but would appreciate any help.I would be glad to upload the EA and indicator if i can figure it out lol.