Hey guys! I'm very new to writing EA and just trying to learn the basic of it by making a simple moving average cross over + RSI + trailing stop loss EA. My code is as below but I can't find any reason why it keeps saying unbalanced left parenthesis. I even check every single parenthesis with the "find" button on it and still can't find it. Here's the code below.. If anyone can help me with this, I'll certainly appreciate it!
<CODE REMOVED>
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
Hey guys! I'm very new to writing EA and just trying to learn the basic of it by making a simple moving average cross over + RSI + trailing stop loss EA. My code is as below but I can't find any reason why it keeps saying unbalanced left parenthesis. I even check every single parenthesis with the "find" button on it and still can't find it. Here's the code below.. If anyone can help me with this, I'll certainly appreciate it!
Looks like it's here . . .
else if ( OrderType() == OP_SELL && currentDirection == 1 && TrailingStop>0 && ( ( OrderOpenPrice()-Ask ) > ( Point*TrailingStop ) ) && ( ( OrderStopLoss() > ( Ask+Point*TrailingStop ) )
. . . adding spaces helps to make things clearer.
Looks like it's here . . .
. . . adding spaces helps to make things clearer.
Hey thanks so much for that! adding spaces! why didn't I think of that. That's brilliant!
How did you find that so quickly? did you come across a lot of this problem before?
Thank you for editing . . .
Yes, it's a reasonably frequent question on this forum, with practice you get to know what to look for. You can also pull the code into the MT5 MetaEditor and it will show matching braces . . . it can help find issues faster.
( ) braces are easier to find than { } braces, consistent indenting style helps with { } braces.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey guys! I'm very new to writing EA and just trying to learn the basic of it by making a simple moving average cross over + RSI + trailing stop loss EA. My code is as below but I can't find any reason why it keeps saying unbalanced left parenthesis. I even check every single parenthesis with the "find" button on it and still can't find it. Here's the code below.. If anyone can help me with this, I'll certainly appreciate it!