Invalid Volume Error Need some help

RickCreation

Trader
Feb 9, 2023
8
0
17
41
So i am having some issues with my new ea i made it is giving me some invalid volume error.
MQL5:
// count open positions
   int cntBuy, cntSell;
   if(!CountOpenPositions(cntBuy,cntSell)){return;}
 
   // check for buy positions
   if (cntBuy==0 && bufferRSI[1]>=(100-RSI_Level) && bufferRSI[0]<(100-RSI_Level) && currentTick.ask>bufferMA[0]){
 
     if(Close_by_Opposite){if(!ClosePositions(2)){return;}}
     double sl = Stop_LOSS==0 ? 0 : currentTick.bid - Stop_LOSS * _Point;
     double tp = TAKE_PROFIT==0 ? 0 : currentTick.bid + TAKE_PROFIT * _Point;
     if(!NormalizePrice(sl)){return;}
     if(!NormalizePrice(tp)){return;}
 
 
     trade.PositionOpen(_Symbol,ORDER_TYPE_BUY,Lot_Size,currentTick.ask,sl,tp," ");
 
   }
 
   // check for sell positions
   if (cntSell==0 && bufferRSI[1]<=RSI_Level && bufferRSI[0]>RSI_Level && currentTick.bid<bufferMA[0]){
 
 
     if(Close_by_Opposite){if(!ClosePositions(1)){return;}}
     double sl = Stop_LOSS==0 ? 0 : currentTick.ask + Stop_LOSS * _Point;
     double tp = TAKE_PROFIT==0 ? 0 : currentTick.ask - TAKE_PROFIT * _Point;
     if(!NormalizePrice(sl)){return;}
     if(!NormalizePrice(tp)){return;}
 
     trade.PositionOpen(_Symbol,ORDER_TYPE_SELL,Lot_Size,currentTick.bid,sl,tp," ");
 
   }

I do understand that normalizedouble should go in the section sl & tp defined
MQL5:
double sl = Stop_LOSS==0 ? 0 : currentTick.bid - Stop_LOSS * _Point;
double tp = TAKE_PROFIT==0 ? 0 : currentTick.bid + TAKE_PROFIT * _Point;

but when i try to add it like below i get errors
MQL5:
double sl = Stop_LOSS==0 ? 0 :NormalizeDouble(( currentTick.bid - Stop_LOSS) * _Point),_Digits;

or when i try to add it like this i also get errors
MQL5:
double sl = Stop_LOSS==0 ? 0 :NormalizeDouble ((( currentTick.bid - Stop_LOSS) * _Point),_Digits);
so i am very confused at why this would be giving me errors i was wondering if someone could show me what i should be writing to fix this issue.