How can i Sell High Price value

 
My Code

#include <Trade\Trade.mqh>
#include <Trade\PositionInfo.mqh>

int pos=0;
int myRSIDefinition;
MqlRates Price_info[];
CTrade trade; // To send orders and close positions
CPositionInfo positionInfo; // to get info about current positions
double entryPrice = 0;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
// Define the handler once at EA Init, not every tick
   myRSIDefinition=iRSI(_Symbol,PERIOD_M20,14,PRICE_CLOSE);
// If is not posible to get indicator handler print some error information and return with error code
   if(myRSIDefinition==INVALID_HANDLE)
     {
      Print("There was an error creating RSI handler!");
      return(INIT_FAILED);
     }
   return INIT_SUCCEEDED;
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   string signal="";
   double  Ask=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),Digits());
   double  Bid=NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_BID),Digits());
   double myRSIArray[];
   
   
   //array
   CopyRates(_Symbol,PERIOD_M30,0,5,Price_info);
   ArraySetAsSeries(Price_info,true);
   ArraySetAsSeries(myRSIArray,true);
   CopyBuffer(myRSIDefinition,0,0,3,myRSIArray);
   //array close
   
   
   
   double myRSIValue=NormalizeDouble(myRSIArray[0],2);
   if(myRSIValue<35)
      signal="sell";
   if(myRSIValue>70)
      signal="buy";
      
   if(PositionSelect(_Symbol) == false)
   {
      if(signal=="buy")
      {
         trade.Buy(1,_Symbol);
         entryPrice = Ask;
         Comment("The current signal is: ",signal);
      }
      if(signal=="sell")
      {
         trade.Sell(1,_Symbol);
         entryPrice = Bid;
         Comment("The current signal is: ",signal);
      }
   }
}
Files:
 
Pruthvirajsinh6212: How can i Sell High Price value
Reverse your criteria
   if(myRSIValue<35)
      signal="sell";
   if(myRSIValue>70)
      signal="buy";
 
  if(PositionSelect(_Symbol) == true)
   {
      if(positionInfo.PositionType()==POSITION_TYPE_BUY)
      {
         if(priceinfo[0].Close > (entryPrice + 2))
         {
            trade.PositionClose(_Symbol);
         }
      }
      
      if(positionInfo.PositionType()==POSITION_TYPE_SELL)
      {
         if(priceinfo[0].Close < (entryPrice - 2))
         {
            trade.PositionClose(_Symbol);
         }
      }
   }
i want sell on high price if my position buy on 35 then automatically sell on  high price like(this code error show me)
PositionSelect(_Symbol) == true
Reason: