How modified indicator script mq4

 

Hi, I have a problem to modified a script mq4. i dont know how to make it.

I want the arrow show when complete this rules:


1. H1 timeframe

2. close candle (1) > highers 4 previous candle H1

3. Candle (1) > 10pips

4. Candle (1) > cloce previous candle H4


//----------------------------------------------------------------------------------------------



#property indicator_chart_window

#property indicator_buffers 2

#property indicator_color1 LawnGreen

#property indicator_color2 Red



//extern int MA_Period =20;

//extern int MA_Type = 0;

//extern int App_Price = 0;

double PipValue = 1;

double MA;

double MB;

double MC;

double MD;

double ME;

double MAA;

double CrossUp[];

double CrossDown[];

int current = 0;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

SetIndexStyle(0, DRAW_ARROW, EMPTY);

SetIndexArrow(0, 225);

SetIndexBuffer(0, CrossUp);

SetIndexStyle(1, DRAW_ARROW, EMPTY);

SetIndexArrow(1, 226);

SetIndexBuffer(1, CrossDown);



return(0);

}

//+------------------------------------------------------------------+

//| script program start function |

//+------------------------------------------------------------------+

int start()

{

MA =0 ;

int counted_bars = IndicatorCounted();

int i;

int limit;

if(counted_bars < 0) 

return(-1);

if(counted_bars > 0) 

counted_bars--;

limit = Bars - counted_bars;

for(i=0; i<=limit; i++)

{

    MA = High[iHighest(NULL,NULL,MODE_HIGH,5,2)];

    MAA = Low[iLowest(NULL,NULL,MODE_LOW,5,2)];

    MB = (Close[1]-Open[1])/(PipValue*Point);

    MC = MB > 100;

    MD = Close[1]> MA;

    ME = Close[2];

CrossUp[i] = EMPTY_VALUE;

CrossDown[i] = EMPTY_VALUE;

if 

(Open[i] > MA )



{

CrossUp[i]=Low[i] - 0.0005;

} 

if 

(Open[i] < MAA )



{

CrossDown[i]=High[i] + 0.0005; 

}

}

return(0);

}

//+------------------------------------------------------------------+
Reason: