Having Troubles using iMAOnArray to Calculate TDI Values in EA

 
Hey guys, just looking for a little guidance for using iMAOnArray in an EA.  I am able to compile the code, however I can't seem to get the values to Comment for some reason.  Any assistance would be appreciated.
//Calculate the Trade Signal Line, Price Line & Yellow Base Line from RSI 34 Period Moving Average ---  Having troubles getting iMAOnArray to work in EA -   

   double priceLineRSI[];
   double priceLineRSISignal[];
   double tradeSignalLine[];
   double marketBaseLine[];

   int iNewBars;
   int iCountedBars;
   int i;

   //Get Unprocessed Ticks
   iCountedBars=IndicatorCounted();{
   if(iCountedBars < 0) {
      for(i = iNewBars-1; i>=0; i--) {
      priceLineRSI[i] = iRSI(symb,PERIOD_M15,RSI_Period,PRICE_CLOSE,i);
        Comment("New TDI Data1: "+priceLineRSI[i]);
   }
   
   if (iCountedBars > 0) {
   iCountedBars--;
   iNewBars = Bars-iCountedBars;
   }
   }
   
   //Calculate TDI Data  
   for(i = iNewBars-1; i>=0; i--) { 
   priceLineRSI[i] = (iRSI(symb,PERIOD_M15,RSI_Period,PRICE_CLOSE,i));
    Comment("New TDI Data2: ");
   }
   
   for(i = iNewBars-1; i>=0; i--) {
   priceLineRSISignal[i] = iMAOnArray(priceLineRSI,PERIOD_M15,RSI_Price_Line,0,MODE_SMA,i);
   tradeSignalLine[i] = iMAOnArray(priceLineRSI,PERIOD_M15,Trade_Signal_Line,0,MODE_SMA,i);
   marketBaseLine[i] = iMAOnArray(priceLineRSI,PERIOD_M15,Volatility_Band,0,MODE_SMA,i);
   } 
   Comment("Price Line1: "+priceLineRSISignal[i]+"\n"+"Trade Signal Line: "+tradeSignalLine[i]+"\n"+"Market Base Line: "+marketBaseLine[i]);
  }
 
  1. Your arrays have no size. You would know that if you had used strict. Always use strict. Fixing the warnings will save you hours of debugging.

  2. There is no IndicatorCounted in EAs.

  3. Why did you post your MT4 question in the Root / MT5 General section  instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

 
William Roeder:
  1. Your arrays have no size. You would know that if you had used strict. Always use strict. Fixing the warnings will save you hours of debugging.

  2. There is no IndicatorCounted in EAs.

  3. Why did you post your MT4 question in the Root / MT5 General section  instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

It's my first time posting, will do a better job next time.  Thanks for sending me in the right direction.  Appreciated!
 

You should balance your indentation. Do this with the Styler of the editor. Tools-Styler or ctrl+,

I don't see any function like OnTick, OnCalculate etc. Is it an indicator? Where do you set the size of that priceline array?

Reason: