Undeclared identifier usually means scope or spelling
MetaEditor cannot resolve a name when it was never declared, is misspelled, belongs to another function scope, or comes from an API that is not MQL4. Copying MQL5 position classes or Pine Script namespaces into an .mq4 file creates valid-looking but unavailable identifiers.
Find the intended owner of the name. A local variable must be declared before use, an input belongs at global scope, and an MQL5-only API needs an MQL4 design rather than a rename.
- Check capitalization and spelling at the first reported use
- Check whether the declaration is inside another block or function
- Confirm the function exists in the MQL4 reference
- Do not silence the message with an unrelated dummy declaration
