heilp with indicator import

 
Can someone direct me on how to import
the indicator heiken_ashi_ma_20 into my
expert? Help me point out which condition
qualifies for long and short in the code????
{
maOpen=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_OPEN,pos);
maClose=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_CLOSE,pos);
maLow=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_LOW,pos);
maHigh=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_HIGH,pos);
//----
haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2;
haClose=(maOpen+maHigh+maLow+maClose)/4;
haHigh=MathMax(maHigh, MathMax(haOpen, haClose));
haLow=MathMin(maLow, MathMin(haOpen, haClose));
if (haOpen<haClose)
{
ExtMapBuffer1[pos]=haLow;
ExtMapBuffer2[pos]=haHigh;
}
else
{
ExtMapBuffer1[pos]=haHigh;
ExtMapBuffer2[pos]=haLow;
}
ExtMapBuffer3[pos]=haOpen;
ExtMapBuffer4[pos]=haClose;
pos--;
That is i want to be clear what to code in the expert(am novice)
Go long when so so happens, go short when so so happens.
wHICH OF THE LINES OF CODE IS RESPONSIBLE FOR THE FOR THE FIRST BUY AND FIRST
SELL SIGNALS???
thank you in advance!!!!!!!!!!!!!
Files:
 

// firstly, you save the indicator inside the" \indicators\" folder of the terminal. Then you compile it.



// value of buffer 1 from previous period

double hh = iCustom(Symbol(),0,"_Heiken_Ashi_Mat20",1,20,1,1);
Print(hh);


// value of buffer 2 from previous day

double hh2 = iCustom(Symbol(),PERIOD_D1,"_Heiken_Ashi_Mat20",1,20,2,1);
Print(hh2);


/*

In must know what this indicator tells you in order to trade. Suppose that current day and before is the signal (I don't know whether it is):

double d0 = iCustom(Symbol(),PERIOD_D1,"_Heiken_Ashi_Mat20",1,20,2,0);

double d1 = iCustom(Symbol(),PERIOD_D1,"_Heiken_Ashi_Mat20",1,20,2,1);

if(d0>d1) {

// go trading....

}


*/

Reason: