MQL 5 is PositionSelect

 
how can i be declare in mql4
if(PositionSelect(_Symbol) == false) 
 {
    //Buy code
    if( EMA_handle[0] > SMMA_handle[0])
       { trade.Buy(0.1,_Symbol); }
    //Sell Code
     if( EMA_handle[0] < SMMA_handle[0])
        { trade.Sell(0.1,_Symbol); }

 }

if(PositionSelect(_Symbol) == true) 
{
   
  if(positionInfo.PositionType()==POSITION_TYPE_BUY)
  {
    if(EMA_handle[0] > SMMA_handle[0])
      {trade.PositionClose(_Symbol);}

   }
  if(positionInfo.PositionType()==POSITION_TYPE_SELL)
  {
    if(EMA_handle[0] < SMMA_handle[0])
      {trade.PositionClose(_Symbol);}
   }

}


any idea guys how can i convert to mql 4
 
  1. There are no positions in MT4. Only orders.
  2. Perhaps you should read the manual. Trade Functions - MQL4 Reference

       How To Ask Questions The Smart Way. (2004) www.catb.org/esr/faqs/smart-questions.html
          How To Interpret Answers. www.catb.org/esr/faqs/smart-questions.html#answers
             RTFM and STFW: How To Tell You've Seriously Screwed Up. www.catb.org/esr/faqs/smart-questions.html#rtfm
 
Pruthvirajsinh6212:
how can i be declare in mql4 any idea guys how can i convert to mql 4
bool PositionSelect(string symbol)
{
   for(int i=0;i<OrdersTotal();i++)
   {
      if(OrderSelect(i, SELECT_BY_POS))
      {
         if(OrderType()<=1 && OrderSymbol()==symbol) return true;
      }
   }
   return false;
}