Code Error Kindly Guide

 

Kindly Guide on what could be wrong with the following code snipet,



------------------------------

//+------------------------------------------------------------------+
//| spread.mq4 |
//| Copyright © 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
double ExtMapBuffer[];
double ExtMapBuffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,0,5,Red);
SetIndexBuffer(0,ExtMapBuffer);
SetIndexBuffer(1,ExtMapBuffer2);
ObjectsDeleteAll();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
for (int i=0;i<Bars;i++)
{
ExtMapBuffer2[i] = iMomentum(Symbol(),0,14,PRICE_CLOSE,i);
}
for (i=0;i<Bars;i++)
{
ExtMapBuffer[i]=iMAOnArray(ExtMapBuffer2,Bars,5,0,MODE_SMA,i);
}
//----
return(0);
}
//+------------------------------------------------------------------+

 

the code snippet is perfect, because it works like the programmer has coded it.

if you are the programmer and expected other results, we should at least know what you expected and what the real results are...

 
looks like quiz ;)