Open parenthesis expected

 
void OnTick()

  {

   double price = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID), Digits);



   // Check for long condition

   if(price > lowerBand && iRSI(_Symbol, 0, RSI_period, 14) > 50)

     {

      // Perform additional checks and execute long trade

      CheckAndExecuteLongTrade();

     }

I'm getting this error with this piece of code:

But I don't see the mistake, anyone can help?



Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
  • www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger() , SymbolInfoDouble() and SymbolInfoString() . The first...
 
riversmme:

I'm getting this error with this piece of code:

Balance your brackets { }
And use the code button <|> or alt-s to post code
 
  1. Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
          General rules and best pratices of the Forum. - General - MQL5 programming forum #25 (2019)
              Messages Editor
          Forum rules and recommendations - General - MQL5 programming forum (2023)

  2.  iRSI(_Symbol, 0, RSI_period, 14) > 50

    Perhaps you should read the manual, especially the examples.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

    They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
              Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
              Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
              How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
              How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
              MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
              How to call indicators in MQL5 - MQL5 Articles (2010)

 
riversmme:
But I don't see the mistake

Look here:

riversmme:
double price = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID), Digits);