need help with a simple indicator

 

I am trying to write a very simple indicator to draw an arrow 20 points below the low when a fast ma crosses above the slow ma and to draw an arrow 20 point above the high when the fast ma crosses below the slow ma. The code seems to be doing exactly opposite of what I want it to do. This seems to be a trivial issue but has been trobling me for a while. Any help on this will be appreciated.

Here is the code I have written.

//+------------------------------------------------------------------+
//| Entry. mq4 |
//| Sanju Chand |
//| sanjuchand@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "Sanju Chand"
#property link "sanjuchand@yahoo.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 SeaGreen
//---- buffers
double ExtMapBuffer1[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexBuffer(0,ExtMapBuffer1);

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
double min15ma14now, min15ma7now, min15ma14prev, min15ma7prev;
int cross;
int pos=Bars-counted_bars-1;
while(pos>=0)
{
min15ma14now=iMA(Symbol(),PERIOD_M15,14,0,MODE_EMA, PRICE_CLOSE, pos);
min15ma7now=iMA(Symbol(),PERIOD_M15,7,0,MODE_EMA, PRICE_CLOSE, pos);
min15ma14prev=iMA(Symbol(),PERIOD_M15,14,0,MODE_EMA, PRICE_CLOSE, pos-1);
min15ma7prev=iMA(Symbol(),PERIOD_M15,7,0,MODE_EMA, PRICE_CLOSE, pos-1);

cross=0;
if (min15ma7now>min15ma14now && min15ma7prev<min15ma14prev)cross=1;
if (min15ma7now<min15ma14now && min15ma7prev>min15ma14prev)cross=-1;

if (cross==1)ExtMapBuffer1[pos]=Low[pos]-20*Point;
if (cross==-1)ExtMapBuffer1[pos]=High[pos]+20*Point;

pos--;
}
return(0);
}
//+------------------------------------------------------------------+

 
previous occurence is not pos-1 but pos+1 as series arrays go in the opposite order from high to low.
 
Awesome..Thank You..Thank You...Thank You...
Reason: