Need help with my CODE please

 

I have 4 errors and 2 warnings in my code need help with it big time been looking at this for a few days now and i cant come up with the solution PLEASE HELP!

errors are 'while' - semicolon expected, '&&' - operand expected, ')' - unexpected token, and lastly 'else' - illegal 'else' without matching 'if'

this is the code  

void OnTick()

  {

//---

    for(int i = 0; i<10; i++);

   PriceAction[i] = Open[i] && Close[i] && Vol;

     if((MovingAverageValue200) > PriceAction[i] && while( PriceAction[1] Close <= PriceAction[2]Open && PriceAction[1] Open > PriceAction[2] Close && PriceAction[1] Vol < PriceAction[2] Vol))

      {

      //sell

      order = OrderSend(NULL, OP_SELL, 0.01, PriceAction[0], NULL, 20, 30, "THIS IS A SELL", 1, 0, clrRed);

     }

   else

     if((MovingAverageValue200 < PriceAction[i]) && while (PriceAction[1] Close >= PriceAction[2]Open && PriceAction[1] Open < PriceAction[2] Close && PriceAction[1] Vol < PriceAction[2] Vol))

        {

         //buy

         order = OrderSend(NULL, OP_BUY, 0.01, PriceAction[0], NULL, 20, 30, "THIS IS A BUY", 1, 0, clrGreen);

  }

}

//+------------------------------------------------------------------+

double MovingAverageValue200 = iMA(NULL,0,200,0,MODE_EMA,PRICE_MEDIAN,0);


double PriceAction[10] = {0,1,2,3,4,5,6,7,8,9};


int i = 0;


int Vol = iVolume(NULL, 0, 0);


int order;

 

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button

 
xobeastmodeox: I have 4 errors and 2 warnings

Don't double post! You already had another thread open.

          General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)