You need more than that for even the most basic script, so yes MetaEditor will give you errors.
As an aside, in MT4 terminology a "script" is something quite specific. You will most likely be wanting to use that snippet in an EA.
That code is also very basic. It doesn't cater for magic numbers or different symbols. But maybe you don't need that. You will find many, many threads on here about counting orders and restricting new ones.

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
I found this script on the forum for limiting open orders but I put it into metaeditor and it givevs me errors when i try to compile it. and would this work with an ea i have on a char like eur usd or usd jpy?
...
if(OrdersTotal()>=MAX_ORDERS)
{
// Don't add new orders
}
else
{
// You can add new orders
}