hi guys i have tried for hours and still couldn't find the problem on this code im new to coding so i don't know exactly what to look for i saw another page dedicated to this that said to check if the brackets were all good, i cheked and they seem good how can i fix it?
- i have this error 'if' - expressions are not allowed on a global scope
- Please Help
- Help: How to write simple EA to buy and sell at a specific time?
Please don't post randomly in any section. Your question is not related to the section you posted.
MT4/mql4 has it's own section on the forum.
It has been move, so please don't create another topic.
moreor: i have tried for hours and still couldn't find the problem on this code
I don't think you tried very hard.
-
bool trezzo = mainStoch_1 < signalStoch_1 && mainStoch_2 >= signalStoch_2 && mainStoch_1 > 80; } <<<<<<<<<<<<<<< End of function. if (ariete && !presenteOrdineMercatoBarra() ) <<< 'if' - expressions are not allowed on a global scope { inserisciOrdineBuyEChiudiSell ( 0.1, "Buy" ) }
The compile error message showed the first problem (if you had clicked on it).
If you had used the styler, the indenting would have easily shown you the first issue.
-
If you had commented out (/* … */) the remaining functions, you would have easily seen the next problem by the error message.
If you had used the styler, the indenting would have easily shown you the next issue.
void OnTick(){ ⋮ if (trezzo && !presenteOrdineMercatoBarra() ) { inserisciOrdineSellEChiudiBuy ( 0.1 "Sell" ) } vvvvvvvvvvvvvvvvvv What are those lines doing inside OnTick? input int magic = 1; //Magic Number //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool presenteOrdineMercato(){ … } ^v^v^v^v^v^v^v^v^v What are those lines doing inside OnTick?
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