How to put custom indicator to ea?

hello every one…
i have this indicator, but don’t know to input it to ea…
this is my indicator code:
extern int period = 15;
extern int method = 1;
extern int price = 0;
double g_ibuf_88[];
double g_ibuf_92[];
double g_ibuf_96[];

int init() {
IndicatorBuffers(3);
SetIndexBuffer(0, g_ibuf_88);
SetIndexBuffer(1, g_ibuf_92);
SetIndexBuffer(2, g_ibuf_96);
ArraySetAsSeries(g_ibuf_96, TRUE);
SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
IndicatorShortName(“Slope Direction Line(” + period + “)”);
return (0);
}

int deinit() {
return (0);
}

double WMA(int ai_0, int a_period_4) {
return (iMA(NULL, 0, a_period_4, 0, method, price, ai_0));
}

int start() {
double lda_16[];
double lda_20[];
int l_ind_counted_0 = IndicatorCounted();
if (l_ind_counted_0 < 0) return (-1);
int li_4 = 0;
int l_period_8 = MathSqrt(period);
int li_12 = Bars - l_ind_counted_0 + period + 1;
if (li_12 > Bars) li_12 = Bars;
ArrayResize(lda_16, li_12);
ArraySetAsSeries(lda_16, TRUE);
ArrayResize(lda_20, li_12);
ArraySetAsSeries(lda_20, TRUE);
for (li_4 = 0; li_4 < li_12; li_4++) lda_16[li_4] = 2.0 * WMA(li_4, period / 2) - WMA(li_4, period);
for (li_4 = 0; li_4 < li_12 - period; li_4++) g_ibuf_96[li_4] = iMAOnArray(lda_16, 0, l_period_8, 0, method, li_4);
for (li_4 = li_12 - period; li_4 >= 0; li_4–) {
lda_20[li_4] = lda_20[li_4 + 1];
if (g_ibuf_96[li_4] > g_ibuf_96[li_4 + 1]) lda_20[li_4] = 1;
if (g_ibuf_96[li_4] < g_ibuf_96[li_4 + 1]) lda_20[li_4] = -1;
if (lda_20[li_4] > 0.0) {
g_ibuf_88[li_4] = g_ibuf_96[li_4];
if (lda_20[li_4 + 1] < 0.0) g_ibuf_88[li_4 + 1] = g_ibuf_96[li_4 + 1];
g_ibuf_92[li_4] = EMPTY_VALUE;
} else {
if (lda_20[li_4] < 0.0) {
g_ibuf_92[li_4] = g_ibuf_96[li_4];
if (lda_20[li_4 + 1] > 0.0) g_ibuf_92[li_4 + 1] = g_ibuf_96[li_4 + 1];
g_ibuf_88[li_4] = EMPTY_VALUE;
}
}
}
return (0);
}

what about in the ea?
thx…

you can call the indicator from the EA using the iCustom function

ya, i know a little of iCustom, but this indicator using like array, so maybe difficult to convert to ea…

this is my ea:
extern double TakeProfit = 12;
extern double StopLose = 12;
extern double Lots = 0.1;
extern double MACDOpenLevel=3;
extern double MACDCloseLevel=2;
extern double MATrendPeriod=26;
double Pip;
//±-----------------------------------------------------------------+

int init()
{
Pip = Point;
if(Digits==3||Digits==5)Pip*=10;
TakeProfit *= Pip;
StopLose *= Pip;
}

//±-------------------------------------------------------- ---------+
int start()
{
int total, ticket;
double MacdCurrent, MacdPrevious, SignalCurrent,MacdPrevious2,MacdPrevious3,MacdPrevious4;
MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);
MacdPrevious2=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,2);
MacdPrevious3=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,3);
MacdPrevious4=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,4);

if(New_Bar()){
if (MacdPrevious3<-0.00005 && MacdPrevious2<0 && MacdPrevious>0.00005)

{
ticket=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,4),3,NormalizeDouble(Ask-StopLose,Digits),NormalizeDouble(Ask+TakeProfit,Digits),0,Green) ;
}
}
return(0);
}

i put indicator code to ea like this:
double WMA(int ai_0, int a_period_4)=(iMA(NULL, 0, a_period_4, 0, method, price, ai_0));

but error…
maybe the int start from indi code must put into this ea too, but if i put, many error…

how about u?
thx…