Download MetaTrader 5
To add comments, please log in or register
Interested in Signals activity? Come and track!
Ernest Klokow
1082
Ernest Klokow 2014.04.07 11:29  

I see I am getting other similar errors also. Looks like my code is a mess!

'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'return' - expressions are not allowed on a global scope
'}' - expressions are not allowed on a global scope

qjol
3243
qjol 2014.04.07 11:33  
GumRai:

It is probably the code prior to your posted code

If it has one too many "}"

Then you will get that error


i agree with "GumRai"
Keith Watford
Moderator
8873
Keith Watford 2014.04.07 12:21  

Ernest,

Try Tools\Options\General and tick the "Highlight matching brackets" box

Makes finding errors like this much easier :)

Alain Verleyen
Moderator
29657
Alain Verleyen 2014.04.07 15:25  
ernest02:

I see I am getting other similar errors also. Looks like my code is a mess!

'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'return' - expressions are not allowed on a global scope
'}' - expressions are not allowed on a global scope

The problem is, as said, that you made an error in the placement of your for loop code.

You need to copy and paste more code here if you can't find the problem.

Carl Schreiber
6161
Carl Schreiber 2014.04.07 17:01  
ernest02:

I see I am getting other similar errors also. Looks like my code is a mess!

'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'if' - expressions are not allowed on a global scope
'return' - expressions are not allowed on a global scope
'}' - expressions are not allowed on a global scope


For those missing ( or ) or { or } I use(d) Notepad++ it can count the brackets to show 'un-equalness' this way.

But the new mt4 editor has better tools for that: Tools->General->enable matching brackets - it easier to see where the {} do not fir.

Gooly

Ernest Klokow
1082
Ernest Klokow 2014.04.08 07:46  

I found the bloody culprit! I had 46 "{" and 47 "}".

THANKS FOR ALL THE HELP GUYS!!

/ /12
To add comments, please log in or register