The error you're encountering, "'(',')' - open parenthesis expected," typically occurs when there's a syntax issue in the code. In MQL5, this error message often suggests that there's a problem with a function call or a parameter list.
Looking at the lines you've mentioned:
request.tp = NormalizeDouble(closePrice[0] + Take_Profit * Point, Digits); // Set take profit level request.tp = NormalizeDouble(closePrice[0] - Take_Profit * Point, Digits); // Set take profit level
The error could arise from the use of Point . In MQL5, Point is a predefined variable representing the smallest price change for a given symbol. However, it's possible that in your environment, Point might not be recognized correctly, leading to this error.
To fix this issue, you need to ensure that Point is properly defined and recognized by the compiler. Here are a few steps you can take:
-
Check Compilation Settings: Make sure you have the correct compiler settings in your MetaEditor. Sometimes, incorrect settings might lead to issues with predefined variables like Point .
-
Include Required Libraries: Ensure that you have included all the necessary libraries that define Point . Typically, it should be included by default in MQL5, but if you're using any custom libraries or environments, you might need to explicitly include them.
-
Declare Point if Necessary: If for some reason, Point is not recognized, you can declare it manually. For example:
double Point = SymbolInfoDouble(_Symbol, SYMBOL_POINT);This line fetches the value of Point for the current symbol ( _Symbol ).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I try to create a simple EA with MQL5, when I run my code I get this error:',' - open parenthesis expected. , I don't know what the problem is , would you please help me to solve this error? Here is my code://+------------------------------------------------------------------+
I got this error in these lines :