Order Send error 3 help

 
tmSignal();
   if (buy()&& (Bid>=RUDuentry && Bid<RUDutp1-min_distance*_Point && RUDuentry>0 && RUDutp1>0 && tmTrade==1 /*&& (dotsBuy<atrproju) && (dotsBT1<drangeh)*/))
   {
         OrderEntry(0,RUDutp1,RUDdentry);
      }
   


   if (sell() && (Bid<=RUDdentry && Bid>RUDdtp1+min_distance*_Point && RUDdentry>0 && RUDdtp1>0 && tmTrade==2 /*&& (dotsSell>atrprojd) && (dotsST1>drangel) &&*/))
   {
         //Print("here"," ",dotsBuySl," ",dotsBuyTp2);
         OrderEntry(1,RUDdtp1,RUDuentry);
      }
   
      if((Close[0]>=R61 && Open[0]<R61)){
         CLOSEALL(0);
      }
      if(Close[0]<=S61 && Open[0]>S61){
         CLOSEALL(1);
      }

  }


double lot;
int send;
void OrderEntry(int direction, double tp, double sl){


      
   if (OpenOrdersThisPair(Symbol())==0 && SymbolInfoInteger(Symbol(),SYMBOL_SPREAD)<MaxSpread
      && (WorkingHour()||WorkingHour2()||WorkingHour3())){
  
   if(direction==0)
   {lot=MMComputeRisk(RiskPercent,Close[0]-sl);
    send=OrderSend(Symbol(),OP_BUY,lot,Ask,Slippage,sl,tp,Trade_Note,MagicNumber,0,clrBlue);}
   
   if(direction==1)
   {lot=MMComputeRisk(RiskPercent,sl-Close[0]);
    send=OrderSend(Symbol(),OP_SELL,lot,Bid,Slippage,sl,tp,Trade_Note,MagicNumber,0,clrRed);}
    
  }

}

Anything stand out in this coding as to why its throwing error 3?

 
Digitals113:

Anything stand out in this coding as to why its throwing error 3?


make sure value sl,tp are correct

then try like this


OrderEntry(0,NormalizeDouble(RUDutp1,Digits),NormalizeDouble(RUDdentry,Digits));
 
Siti Latifah:


make sure value sl,tp are correct

then try like this


This worked. Had to normalizedouble the TP and SL values.

Reason: