MT5: 'for' expressions are not allowed on a global scope
Phoebe Hj:
You put an extra closing brace } on line 85, remove it and it'll compile.
This indicator is similar to the RSI. The idea is to calculate net_profit / [sum(positive returns) + abs(sum(negative returns))] in a rolling window.
But after I changed the code in the main loop, the terminal says: 'for' expressions are not allowed on a global scope
The similar part works for the official RSI. I don't understand this error.
The file is attached below.
Thank you.
This indicator is similar to the RSI. The idea is to calculate net_profit / [sum(positive returns) + abs(sum(negative returns))] in a rolling window.
But after I changed the code in the main loop, the terminal says: 'for' expressions are not allowed on a global scope
The similar part works for the official RSI. I don't understand this error.
The file is attached below.
Thank you.
Update:
I got this warning. But the code is modified from the official RSI and the terminal is up to date.