Program Properties (#property)

Overview

  • Defines specific parameters for MQL4 programs to aid client terminal servicing without explicit execution.
  • Properties must be declared in the main .mq4 file; properties in included files are ignored.
  • Syntax: #property identifier value.
  • Properties

    | Identifier | Type | Description | |---|---|---| | strict | N/A | Compiler directive for strict compilation mode. | | icon | string | Path to ICO file for EX4 program icon. Path follows resource rules. Must be in the main module. | | link | string | URL to the company website. | | copyright | string | Company name. | | version | string | Program version (max 31 characters). | | description | string | Brief program description. Multiple description properties are allowed; total length (including line feeds) max 511 characters. | | stacksize | int | MQL4 program stack size. Default: 8MB for scripts/EAs and strategy tester; 1MB for indicators. | | library | N/A | Declares the program as a library. No start function assigned. Functions with export modifier can be imported. | | indicator_chart_window | N/A | Displays the indicator in the main chart window. | | indicator_separate_window | N/A | Displays the indicator in a separate subwindow. | | indicator_height | int | Fixed height of the indicator subwindow in pixels. | | indicator_minimum | double | Bottom scaling limit for a separate indicator window. | | indicator_maximum | double | Top scaling limit for a separate indicator window. | | indicator_labelN | string | Label for the Nth graphic series in DataWindow. | | indicator_colorN | color | Color for the Nth graphic series (N starts from 1). | | indicator_widthN | int | Thickness for the Nth graphic series (N starts from 1). | | indicator_styleN | int | Line style for the Nth graphic series (N starts from 1). Uses ENUM_LINE_STYLE. | | indicator_typeN | int | Drawing style for the Nth graphic series (N starts from 1). | | indicator_levelN | double | Horizontal level value for N in a separate indicator window. | | indicator_levelcolor | color | Color of horizontal indicator levels. | | indicator_levelwidth | int | Thickness of horizontal indicator levels. | | indicator_levelstyle | int | Style of horizontal indicator levels. | | script_show_confirm | N/A | Displays a confirmation window before script execution. | | script_show_inputs | N/A | Displays input properties window before script execution, disabling the confirmation window. | | tester_file | string | File name from \MQL4\Files\ to be sent to a virtual server. | | tester_indicator | string | Indicator file name from \MQL4\Indicators\ to be sent to a virtual server. | | tester_library | string | Library file name from \MQL4\Libraries\ to be sent to a virtual server. |

    Notes

  • tester_file, tester_indicator, and tester_library are required for virtual hosting file dependencies.
  • Indicators called via iCustom() with fixed names and all used libraries are copied automatically during migration.
  • Refer to the article "How to Prepare a Trading Account for Migration to Virtual Hosting" for migration details.