Hello Im currently working on mq 4 project

 

I keep getting this error in my code can anyone help solve this please.

'[' - array required Thecash.mq4 56 14

'[' - array required Thecash.mq4 56 30

'[' - array required Thecash.mq4 62 14

'[' - array required Thecash.mq4 62 30

'[' - array required Thecash.mq4 76 14

5 errors, 0 warnings 6 1




if (delta[1] < 0 && delta[0] >= 0)

    {

        EnterLong();

        Alert("MacdLE");

    }



    if (delta[1] > 0 && delta[0] <= 0)

    {

        EnterShort();

        Alert("MacdSE");

    }

}



void CalculateIndicators()

{

    for (int i = fastLength; i >= 0; i--)

    {

        MACD[i] = iMA(NULL, 0, fastLength, 0, MODE_EMA, PRICE_CLOSE, i) -

                  iMA(NULL, 0, slowLength, 0, MODE_EMA, PRICE_CLOSE, i);

        aMACD[i] = iMAOnArray(MACD, fastLength, MACDLength, 0, MODE_EMA, i);

        delta[i] = MACD[i] - aMACD[i];
 
  1. Why did you post your MT4 question in the 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? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. if (delta[1] < 0 && delta[0] >= 0)
    

    Your posted code is without context. We have no idea in which function those lines are in, nor what line numbers the error messages apply to, what variables they apply to, or whether you actually created and resized your arrays.

    Always post all relevant code (using Code button) or attach the source file.

  3. AER Services: I keep getting this error in my code can anyone help solve this please.

    Do not post code that will not even compile.
              MT4: Learn to code it.
              MT5: Begin learning to code it.

    If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
              I need HEEEELP, please, it's URGENT...really ! - General - MQL5 programming forum (2017)