opening one position in everey trend by EA

 

this expert opens up a lot of positions in the position. i want to just open one position in up trend or a down trend

thank you


if(NumBuy==0&&NumSell==0)
     {  
         // for SELL
      if( v1!=EMPTY_VALUE  && v0==EMPTY_VALUE && v2==EMPTY_VALUE && v3==EMPTY_VALUE  && Ask <v1 && Bid< v1) {
       OrdrSend=OrderSend(Symbol(),OP_SELL, Lot,Bid,10,0,0,"",0,0,Red);
         } 
        // FOR BUY
        if( v0!=EMPTY_VALUE  && v1==EMPTY_VALUE && v2==EMPTY_VALUE && v3==EMPTY_VALUE  && Ask>v0 && Bid> v0){
         
       OrdrSend=OrderSend(Symbol(),OP_BUY, Lot,Ask,10, 0, 0, "", 0, 0,Green);       
   }
Reason: