Bassey Edet:
Count your brackets "(" - ")" and "{" - "}". If you code is too long I would use notepad++!
Hi Coders,
I have issues with this compile error,
'if' - expressions are not allowed on a global scope
see attachment added
can any one help?
Bassey Edet: Hi Coders, I have issues with this compile error, 'if' - expressions are not allowed on a global scope, see attachment added. can any one help?
All executable code must be within a function (or class methods), such as the Event Handling functions. You cannot have "if()" statements outside of functions in the "global scope".If it is indeed within functions, then check for mismatching brackets and braces, just as @Carl Schreiber has suggested.
Bassey Edet:
Starting from line 264 (and quite a lot more code after that) your code is not a part of any function. Hi Coders,
I have issues with this compile error,
'if' - expressions are not allowed on a global scope
see attachment added
can any one help?
Move that part to it's logical place within the function where it is supposed to do the desired job or, as Carl told : check all your brackets for a missing one
Chalin Saranga Jayathilake:
hellow friends how to fix this error?
Read the topic!
Move your code so that it is inside a function (OnInit() , OnCalculate() or OnTick() )

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
- www.mql5.com
//| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |...
'do' - expressions are not allowed on a global scope EXcuseme what this is? please help me

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi Coders,
I have issues with this compile error,
'if' - expressions are not allowed on a global scope
see attachment added
can any one help?