why can't i plot iMA() ?

 

hi im trying to plot iMA of a formula that yields rather a huge number for each bars its applied on.

Problem is that it constantly freezes. and MT4 Terminal crashes. So i dont know if its drawing the iMA or not.

thank you.

int start()
  {
   int counted_bars = IndicatorCounted();
   int pos = Bars - counted_bars; 
     
 //----
   
   
   if (counted_bars<0) return(-1);
     
   if (counted_bars>0) counted_bars--;
   
   while(pos>=0)
    {
           
        
         //Main Forumla
        // double preFormula = Some_Formula_Here;
         
           double Formula = iMA(NULL,0,2,pos,MODE_SMA,preFormula,pos);
                       
         ExtMapBuffer1[pos] = Formula;
          
         Alert(Formula);
                
     }
 

pos never decremented !!!

Reason: