View Single Post
  #8 (permalink)  
Old 09-18-2006, 05:23 AM
lowphat's Avatar
lowphat lowphat is offline
Senior Member
 
Join Date: Sep 2005
Posts: 200
lowphat is on a distinguished road
looks like you closed your for i loop before placing your imonarray
so u could do something like
Code:
int start()
  {
   double MA, RSI[];
   ArrayResize(RSI,BandPeriod);
   int counted_bars=IndicatorCounted();
   int limit = Bars-counted_bars-1;
   for(int i=limit; i>=0; i--)
   {
      RSIBuf[i] = iRSI(NULL,0,RSIPeriod,MODE_CLOSE,i);
      MA = 0;
      for(int j=i; j<i+BandPeriod; j++) {
         RSI[j-i] = RSIBuf[j];
         MA += RSIBuf[j]/BandPeriod;
      }
         {
      RSIBufdot[i] = iRSI(NULL,0,RSIPeriod,MODE_CLOSE,i);
      }
      UpZone[i] = MA + (1.3185 * StDev(RSI,BandPeriod));
      DnZone[i] = MA - (1.3185 * StDev(RSI,BandPeriod));
      UpZonei[i] = MA + (0.68 * StDev(RSI,BandPeriod));
      DnZonei[i] = MA - (0.68 * StDev(RSI,BandPeriod));   
   }
      for(i=limit; i>=0; i--) 
            {
      SignalMABuf[i]=iMAOnArray(RSIBuf,0,SignalMAPeriod,0,MODE_EMA,i);
            }

Last edited by lowphat; 09-18-2006 at 06:34 AM.
Reply With Quote