[error] ')' - open parenthesis expected ifcondition.mq5

 

Could someone please help me with this error "- open parenthesis expected" it happens at line 8 and line 22.

I don't know what to do. if (range > 650 * Point) if (total_range > 100 * Point)



// Function to check the candle condition
bool CheckCandleCondition() 
{
   // Get the high and low prices of the current candle (bar 0)
   double high_price = iHigh(Symbol(), PERIOD_M1, 0);  // High price of the current candle
   double low_price = iLow(Symbol(), PERIOD_M1, 0);    // Low price of the current candle
   double range = high_price - low_price;               // Range of the current candle
   if (range > 650 * Point) 
   {
      return true;  // If the range of the candle is greater than 650 pips, condition is met
   }

   // Check the total range of the last 3 consecutive candles
   double total_range = 0;
   for (int i = 0; i < 3; i++) 
   {
      // Get the high and low prices of each candle (bar i)
      high_price = iHigh(Symbol(), PERIOD_M1, i);    // High price of candle i
      low_price = iLow(Symbol(), PERIOD_M1, i);      // Low price of candle i
      total_range += (high_price - low_price);        // Add the range of the current candle to the total range
   }
   if (total_range > 100 * Point) 
   {
      return true;  // If the total range of the last 3 candles is greater than 100 pips, condition is met
   }
   return false;  // If neither condition is met, return false
}
 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893