Bug of MQL4 Compiler?

 

I wrote the following code:


#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red


int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer);
//----
return(0);
}

int deinit()
{
return(0);
}
int start()
{
Print(iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i));

return(0);

}


Two types of Output:

1)Output in indicator_separate_window mode

0.9976

2)OutPut in indicator_chart_window mode :

0.99763

Problem: Why does the code give two different result ?


thx.

 

Please well format your code.

#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
 
 
int init()
{
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer);
//----
   return(0);
}
 
int deinit()
{
   return(0);
}
int start()
{
   Print(iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i));
 
   return(0);
}
 

try

Print( DoubleToStr( iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i)), 5);

Reason: