MQL4 Documentation
optimized for AI
MQL4 the trading platform for the future. Also available as an mcp server.
Introduction to MQL4
MQL4 the trading platform for the future
All-in-one Documentation
Download or copy the entire MQL4 documentation as a single minified file.
# MQL4 COMPACT DOCUMENTATION Full documentation coming soon...
MCP Server Access
Expose these documentation modules directly to your AI agents (Claude Desktop, Cursor, etc.) via the Model Context Protocol.
Add to your config
{
"mcpServers": {
"smoldoc": {
"command": "npx",
"args": ["@smoldoc/mcp-server", "--docs", "mql4"]
}
}
}
This allows your agent to perform semantic search across the entire library and pull in exactly the context it needs to write MQL4 code for you.
Documentation Index
| Module | Description | Size |
|---|---|---|
| Others | Mql4 reference | 8kb |
| Others | Mql4 updates | 23kb |
| Others | Language basics | 5kb |
| Language | Syntax | 4kb |
| Others | Comments | 4kb |
| Others | Identifiers | 4kb |
| Others | Reserved words | 6kb |
| Others | Data types | 6kb |
| Types | Integer types | 7kb |
| Types | Character constants | 10kb |
| Types | Datetime type | 6kb |
| Types | Color type | 6kb |
| Types | Bool type | 5kb |
| Types | Enumerations | 6kb |
| Types | Real types | 13kb |
| Types | String type | 6kb |
| Controls | Structures classes interfaces | 45kb |
| Controls | Dynamic array object | 6kb |
| Others | Typecasting | 19kb |
| Types | Void type null constant | 5kb |
| Types | Objectpointers | 9kb |
| Others | References modifier and keyword this | 9kb |
| Others | Operations and expressions | 5kb |
| Others | Expressions | 4kb |
| Others | Arithmetic operations | 6kb |
| Others | Assignment operations | 6kb |
| Others | Operations of relation | 6kb |
| Language | Boolean operations | 7kb |
| Others | Bitwise operations | 8kb |
| Others | Other operations | 11kb |
| Others | Precedence rules | 7kb |
| Others | Operators | 7kb |
| Controls | Compound operator | 5kb |
| Others | Expression operator | 5kb |
| Controls | Return operator | 5kb |
| Controls | If else operator | 6kb |
| Operator | Ternary operator | 8kb |
| Controls | Switch operator | 7kb |
| Controls | While loop operator | 5kb |
| Controls | For loop operator | 6kb |
| Controls | Do while operator | 6kb |
| Controls | Break operator | 5kb |
| Controls | Continue operator | 5kb |
| Operator | Object create operator new | 6kb |
| Operator | Object delete operator | 5kb |
| Others | Functions | 8kb |
| Language | Function call | 6kb |
| Others | Passing parameters | 9kb |
| Language | Function overloading | 10kb |
| Others | Operation overloading | 34kb |
| Others | External functions | 6kb |
| Others | Exporting functions | 5kb |
| Function | Event handling functions | 20kb |
| Others | Variables | 10kb |
| Language | Local variables | 8kb |
| Others | Formal parameters | 7kb |
| Language | Static variables | 6kb |
| Others | Global variables | 6kb |
| Others | Input variables | 11kb |
| Others | Extern variables | 7kb |
| Setups | Initialization of variables | 7kb |
| Others | Variable scope lifetime | 7kb |
| Others | Creating deleting objects | 12kb |
| Others | Preprocessor | 5kb |
| Others | Macro substitution | 8kb |
| Constants | Objectconstants | 7kb |
| Dateandtime | Dayofweek | 5kb |
| Check | Isdllsallowed | 5kb |
| Check | Isexpertenabled | 5kb |
| Check | Islibrariesallowed | 5kb |
| Check | Istradecontextbusy | 5kb |
| Chart | Periodwindow | 6kb |
| Chart | Windowstotal | 6kb |
| Customind | Indicatorshortname | 5kb |
| Indicators | Icci | 6kb |
| Basis | Symbolconstants | 10kb |
| Basis | Color | 6kb |
| Basis | Boolconst | 5kb |
| Basis | Enumeration | 6kb |
| Basis | Double | 13kb |
| Basis | Stringconst | 6kb |
| Basis | Classes | 45kb |
| Basis | Array | 6kb |
| Basis | Casting | 19kb |
| Basis | Void | 5kb |
| Basis | Pointers | 9kb |
| Basis | This | 9kb |
| Basis | Operations | 5kb |
| Basis | Operexpression | 4kb |
| Basis | Mathoperation | 6kb |
| Basis | Assign | 6kb |
| Basis | Bool | 7kb |
| Basis | Bit | 8kb |
| Basis | Other | 11kb |
| Others | Importing functions | 7kb |
| Controls | Program properties | 11kb |
| Others | Include directive | 5kb |
| Language | Conditional compilation | 7kb |
| Others | Oop | 8kb |
| Language | Encapsulation extensibility | 9kb |
| Controls | Inheritance | 17kb |
| Controls | Polymorphism | 12kb |
| Controls | Overload | 5kb |
| Controls | Virtual functions | 11kb |
| Controls | Static members | 13kb |
| Others | Function templates | 12kb |
| Controls | Abstract classes | 8kb |
| Others | Constants enumerations structures | 5kb |
| Others | Chartconstants | 9kb |
| Types | Chart event types | 15kb |
| Others | Chart timeframes | 6kb |
| Controls | Chart properties | 130kb |
| Constants | Positioning constants | 5kb |
| Controls | Chart representation | 6kb |
| Others | Object types | 13kb |
| Controls | Objvline | 16kb |
| Controls | Objhline | 16kb |
| Types | Objtrend | 21kb |
| Controls | Objtrendbyangle | 21kb |
| Controls | Objcycles | 20kb |
| Controls | Objchannel | 23kb |
| Controls | Objstddevchannel | 22kb |
| Controls | Objregression | 19kb |
| Controls | Objpitchfork | 23kb |
| Controls | Objgannline | 23kb |
| Controls | Objgannfan | 22kb |
| Controls | Objganngrid | 23kb |
| Controls | Objfibo | 23kb |
| Controls | Objfibotimes | 23kb |
| Controls | Objfibofan | 22kb |
| Controls | Objfiboarc | 23kb |
| Controls | Objfibochannel | 25kb |
| Controls | Objexpansion | 25kb |
| Controls | Objrectangle | 21kb |
| Controls | Objtriangle | 22kb |
| Controls | Objellipse | 21kb |
| Controls | Objarrowthumbup | 21kb |
| Controls | Objarrowthumbdown | 21kb |
| Controls | Objarrowup | 20kb |
| Controls | Objarrowdown | 20kb |
| Controls | Objarrowstop | 21kb |
| Controls | Objarrowcheck | 21kb |
| Controls | Objarrowleftprice | 18kb |
| Controls | Objarrowrightprice | 18kb |
| Controls | Objarrowbuy | 16kb |
| Controls | Objarrowsell | 16kb |
| Controls | Objarrow | 20kb |
| Controls | Objtext | 19kb |
| Controls | Objlabel | 24kb |
| Controls | Objbutton | 22kb |
| Controls | Objbitmap | 23kb |
| Controls | Objbitmaplabel | 27kb |
| Controls | Objedit | 22kb |
| Controls | Objevent | 16kb |
| Controls | Objrectanglelabel | 21kb |
| Others | Object properties | 20kb |
| Others | Object binding methods | 13kb |
| Others | Chart corner | 10kb |
| Others | Visibility of objects | 8kb |
| Others | Gann objects | 8kb |
| Others | Web colors | 7kb |
| Others | Wingdings | 5kb |
| Constants | Arrow codes | 14kb |
| Others | Indicatorconstants | 7kb |
| Others | Price constants | 5kb |
| Others | Series array identifiers | 5kb |
| Types | Smoothing methods | 5kb |
| Others | Indicator lines | 5kb |
| Others | Drawing styles | 6kb |
| Controls | Custom indicator properties | 11kb |
| Others | Environmentstate | 5kb |
| Others | Client terminal properties | 11kb |
| Others | Running mql4 program properties | 8kb |
| Others | Symbol properties | 16kb |
| Documentation | Account properties | 10kb |
| Others | Testing statistics | 9kb |
| Others | Trade constants | 6kb |
| Others | History database properties | 5kb |
| Types | Order properties | 4kb |
| Others | Signal properties | 7kb |
| Others | Namedconstants | 5kb |
| Others | Predefined macro substitutions | 8kb |
| Others | Mathematical constants | 6kb |
| Others | Numerical type constants | 8kb |
| Others | Uninitialization reason codes | 7kb |
| Others | Checking object pointer | 5kb |
| Others | Other constants | 13kb |
| Others | Mql4 data structures | 5kb |
| Types | Mqldatetime | 5kb |
| Types | Mqlrates | 5kb |
| Types | Mql tick structure | 5kb |
| Others | Codes of errors and warnings | 5kb |
| Others | Trade server return codes | 6kb |
| Others | Compiler warnings | 10kb |
| Others | Compilation errors | 21kb |
| Others | Runtime errors | 5kb |
| Others | Ioconstants | 4kb |
| Others | File opening flags | 8kb |
| Others | File properties | 6kb |
| Others | File positioning | 5kb |
[Others] -> Mql4 reference | Size: 8kb [Others] -> Mql4 updates | Size: 23kb [Others] -> Language basics | Size: 5kb [Language] -> Syntax | Size: 4kb [Others] -> Comments | Size: 4kb [Others] -> Identifiers | Size: 4kb [Others] -> Reserved words | Size: 6kb [Others] -> Data types | Size: 6kb [Types] -> Integer types | Size: 7kb [Types] -> Character constants | Size: 10kb [Types] -> Datetime type | Size: 6kb [Types] -> Color type | Size: 6kb [Types] -> Bool type | Size: 5kb [Types] -> Enumerations | Size: 6kb [Types] -> Real types | Size: 13kb [Types] -> String type | Size: 6kb [Controls] -> Structures classes interfaces | Size: 45kb [Controls] -> Dynamic array object | Size: 6kb [Others] -> Typecasting | Size: 19kb [Types] -> Void type null constant | Size: 5kb [Types] -> Objectpointers | Size: 9kb [Others] -> References modifier and keyword this | Size: 9kb [Others] -> Operations and expressions | Size: 5kb [Others] -> Expressions | Size: 4kb [Others] -> Arithmetic operations | Size: 6kb [Others] -> Assignment operations | Size: 6kb [Others] -> Operations of relation | Size: 6kb [Language] -> Boolean operations | Size: 7kb [Others] -> Bitwise operations | Size: 8kb [Others] -> Other operations | Size: 11kb [Others] -> Precedence rules | Size: 7kb [Others] -> Operators | Size: 7kb [Controls] -> Compound operator | Size: 5kb [Others] -> Expression operator | Size: 5kb [Controls] -> Return operator | Size: 5kb [Controls] -> If else operator | Size: 6kb [Operator] -> Ternary operator | Size: 8kb [Controls] -> Switch operator | Size: 7kb [Controls] -> While loop operator | Size: 5kb [Controls] -> For loop operator | Size: 6kb [Controls] -> Do while operator | Size: 6kb [Controls] -> Break operator | Size: 5kb [Controls] -> Continue operator | Size: 5kb [Operator] -> Object create operator new | Size: 6kb [Operator] -> Object delete operator | Size: 5kb [Others] -> Functions | Size: 8kb [Language] -> Function call | Size: 6kb [Others] -> Passing parameters | Size: 9kb [Language] -> Function overloading | Size: 10kb [Others] -> Operation overloading | Size: 34kb [Others] -> External functions | Size: 6kb [Others] -> Exporting functions | Size: 5kb [Function] -> Event handling functions | Size: 20kb [Others] -> Variables | Size: 10kb [Language] -> Local variables | Size: 8kb [Others] -> Formal parameters | Size: 7kb [Language] -> Static variables | Size: 6kb [Others] -> Global variables | Size: 6kb [Others] -> Input variables | Size: 11kb [Others] -> Extern variables | Size: 7kb [Setups] -> Initialization of variables | Size: 7kb [Others] -> Variable scope lifetime | Size: 7kb [Others] -> Creating deleting objects | Size: 12kb [Others] -> Preprocessor | Size: 5kb [Others] -> Macro substitution | Size: 8kb [Constants] -> Objectconstants | Size: 7kb [Dateandtime] -> Dayofweek | Size: 5kb [Check] -> Isdllsallowed | Size: 5kb [Check] -> Isexpertenabled | Size: 5kb [Check] -> Islibrariesallowed | Size: 5kb [Check] -> Istradecontextbusy | Size: 5kb [Chart] -> Periodwindow | Size: 6kb [Chart] -> Windowstotal | Size: 6kb [Customind] -> Indicatorshortname | Size: 5kb [Indicators] -> Icci | Size: 6kb [Basis] -> Symbolconstants | Size: 10kb [Basis] -> Color | Size: 6kb [Basis] -> Boolconst | Size: 5kb [Basis] -> Enumeration | Size: 6kb [Basis] -> Double | Size: 13kb [Basis] -> Stringconst | Size: 6kb [Basis] -> Classes | Size: 45kb [Basis] -> Array | Size: 6kb [Basis] -> Casting | Size: 19kb [Basis] -> Void | Size: 5kb [Basis] -> Pointers | Size: 9kb [Basis] -> This | Size: 9kb [Basis] -> Operations | Size: 5kb [Basis] -> Operexpression | Size: 4kb [Basis] -> Mathoperation | Size: 6kb [Basis] -> Assign | Size: 6kb [Basis] -> Bool | Size: 7kb [Basis] -> Bit | Size: 8kb [Basis] -> Other | Size: 11kb [Others] -> Importing functions | Size: 7kb [Controls] -> Program properties | Size: 11kb [Others] -> Include directive | Size: 5kb [Language] -> Conditional compilation | Size: 7kb [Others] -> Oop | Size: 8kb [Language] -> Encapsulation extensibility | Size: 9kb [Controls] -> Inheritance | Size: 17kb [Controls] -> Polymorphism | Size: 12kb [Controls] -> Overload | Size: 5kb [Controls] -> Virtual functions | Size: 11kb [Controls] -> Static members | Size: 13kb [Others] -> Function templates | Size: 12kb [Controls] -> Abstract classes | Size: 8kb [Others] -> Constants enumerations structures | Size: 5kb [Others] -> Chartconstants | Size: 9kb [Types] -> Chart event types | Size: 15kb [Others] -> Chart timeframes | Size: 6kb [Controls] -> Chart properties | Size: 130kb [Constants] -> Positioning constants | Size: 5kb [Controls] -> Chart representation | Size: 6kb [Others] -> Object types | Size: 13kb [Controls] -> Objvline | Size: 16kb [Controls] -> Objhline | Size: 16kb [Types] -> Objtrend | Size: 21kb [Controls] -> Objtrendbyangle | Size: 21kb [Controls] -> Objcycles | Size: 20kb [Controls] -> Objchannel | Size: 23kb [Controls] -> Objstddevchannel | Size: 22kb [Controls] -> Objregression | Size: 19kb [Controls] -> Objpitchfork | Size: 23kb [Controls] -> Objgannline | Size: 23kb [Controls] -> Objgannfan | Size: 22kb [Controls] -> Objganngrid | Size: 23kb [Controls] -> Objfibo | Size: 23kb [Controls] -> Objfibotimes | Size: 23kb [Controls] -> Objfibofan | Size: 22kb [Controls] -> Objfiboarc | Size: 23kb [Controls] -> Objfibochannel | Size: 25kb [Controls] -> Objexpansion | Size: 25kb [Controls] -> Objrectangle | Size: 21kb [Controls] -> Objtriangle | Size: 22kb [Controls] -> Objellipse | Size: 21kb [Controls] -> Objarrowthumbup | Size: 21kb [Controls] -> Objarrowthumbdown | Size: 21kb [Controls] -> Objarrowup | Size: 20kb [Controls] -> Objarrowdown | Size: 20kb [Controls] -> Objarrowstop | Size: 21kb [Controls] -> Objarrowcheck | Size: 21kb [Controls] -> Objarrowleftprice | Size: 18kb [Controls] -> Objarrowrightprice | Size: 18kb [Controls] -> Objarrowbuy | Size: 16kb [Controls] -> Objarrowsell | Size: 16kb [Controls] -> Objarrow | Size: 20kb [Controls] -> Objtext | Size: 19kb [Controls] -> Objlabel | Size: 24kb [Controls] -> Objbutton | Size: 22kb [Controls] -> Objbitmap | Size: 23kb [Controls] -> Objbitmaplabel | Size: 27kb [Controls] -> Objedit | Size: 22kb [Controls] -> Objevent | Size: 16kb [Controls] -> Objrectanglelabel | Size: 21kb [Others] -> Object properties | Size: 20kb [Others] -> Object binding methods | Size: 13kb [Others] -> Chart corner | Size: 10kb [Others] -> Visibility of objects | Size: 8kb [Others] -> Gann objects | Size: 8kb [Others] -> Web colors | Size: 7kb [Others] -> Wingdings | Size: 5kb [Constants] -> Arrow codes | Size: 14kb [Others] -> Indicatorconstants | Size: 7kb [Others] -> Price constants | Size: 5kb [Others] -> Series array identifiers | Size: 5kb [Types] -> Smoothing methods | Size: 5kb [Others] -> Indicator lines | Size: 5kb [Others] -> Drawing styles | Size: 6kb [Controls] -> Custom indicator properties | Size: 11kb [Others] -> Environmentstate | Size: 5kb [Others] -> Client terminal properties | Size: 11kb [Others] -> Running mql4 program properties | Size: 8kb [Others] -> Symbol properties | Size: 16kb [Documentation] -> Account properties | Size: 10kb [Others] -> Testing statistics | Size: 9kb [Others] -> Trade constants | Size: 6kb [Others] -> History database properties | Size: 5kb [Types] -> Order properties | Size: 4kb [Others] -> Signal properties | Size: 7kb [Others] -> Namedconstants | Size: 5kb [Others] -> Predefined macro substitutions | Size: 8kb [Others] -> Mathematical constants | Size: 6kb [Others] -> Numerical type constants | Size: 8kb [Others] -> Uninitialization reason codes | Size: 7kb [Others] -> Checking object pointer | Size: 5kb [Others] -> Other constants | Size: 13kb [Others] -> Mql4 data structures | Size: 5kb [Types] -> Mqldatetime | Size: 5kb [Types] -> Mqlrates | Size: 5kb [Types] -> Mql tick structure | Size: 5kb [Others] -> Codes of errors and warnings | Size: 5kb [Others] -> Trade server return codes | Size: 6kb [Others] -> Compiler warnings | Size: 10kb [Others] -> Compilation errors | Size: 21kb [Others] -> Runtime errors | Size: 5kb [Others] -> Ioconstants | Size: 4kb [Others] -> File opening flags | Size: 8kb [Others] -> File properties | Size: 6kb [Others] -> File positioning | Size: 5kb