Script is a program written in metaquotes language 4 (mql4) and intended for a single performing of any actions. Unlike experts, scripts are executed on request, not by ticks. In other words, where an expert works almost continuously, a script, having completed the function once,.
A template is created in the directory corresponding to a program type mql5scripts (or mql4scripts). When creating a template, you can define the program inputs beforehand.
Lets say we have 20 open orders on one symbol and want to set takeprofit or stoploss for all of them at the same level(price). The script selects all open orders of the symbol and can modify stoploss or takeprofit or both at the desired level (price). If the input parameters are left to zero , the stop or the takeprofit are left unchanged.
i want to write mt4 scripts that allow me to enter input before the script is executed.
Mt4 contains a simple method for referencing the prices and data of different symbols in mql4. The marketinfo () function has many uses, all of which will not be explored in this article. Marketinfo () can be used to retrieve the bid and ask prices of the currently selected symbol as mt4 iterates through.
Ill teach you how to write a forex robot or expert advisor ea from the beginning. Do not be afraid that you have zero knowledge in forex mt4 programming language. During the lesson, ill show you the easy way to write code and youll understand the logic behind. Throughout the class, youll be given examples and practice on the spot.
The use of its embedded programming language, mql4, lifts traders to a new level of trading - to automated trading. Now, a trader can implement his or her ideas as an application program - write a custom indicator, a script to perform single operations, or create an expert advisor - an automated trading system (trading robot).
emmzett thank you for the explanation , but ive used a hot key solution in the end. - set up a hot key in mt4 on the script , in this case ctrl-m - used this code to call it.