Launch of Scripts

After general parameters have been set up, the script can be launched. To do so, it is enough just to attach it to the chart. At that, of there is a “#property show_inputs” instruction in the program source code, the script setup window will appear automatically. In the “Common” tab of this window, one can:

  • positions — select direction of position opening:

    1. Long&Short — both long and short;

    2. Only Long — only to buy;

    3. Only Short — only to sell.

  • Enable alerts — enable/disable script alerts;

  • Disable alert once hit — disable alerting after the first alert has been made;

  • Allow live trading — enable/disable live trading;

  • Ask manual confirmation — request for manual confirmation of position opening when performing trade operations;

  • Allow DLL imports — enable/disable importing of functions from DLL files;

  • Confirm DLL function calls — request for confirmation at each call of functions from DLL files;

  • Allow import of external experts — enable/disable calling of functions from external experts.

External variables of the script can be changed in the “Inputs” tab. They are variables of extern class. To change a parameter, one has to double-click with the left mouse button on its value and write the new one. At that, one can change the value of each variable or download the set of inputs already saved before (the “Load” button). One can save the current set of inputs with the button of the same name.

The “Reset” button returns all default settings. Parameters defined in the terminal settings are set in the “Common” tab. And parameters set in the source code of the program are defined as inputs. The script with the defined parameters can be confirmed by pressing of “OK” and canceled by pressing of button of the same name.

Attention: Unlike those of experts or custom indicators, special properties of the script are set only at its launch.

Script will be launched immediately after that. Double click with the left mouse button on the selected script in the “Navigator — Scripts” window or execution of the “Execute on Chart” command of the script context menu will attach the script to the active chart. The “Drag’n'Drop” technique will allow to attach the script to any chart. If the “Remove Script” command appears in the chart context menu, it means that script is working. This command is active only while this MQL4 program is working.

Attention: Only one script can be attached to a chart.