How to write a script to work on Forex
Modern trading is already quite difficult to imagine without automation, and with today’s level of development of computer technology, not only simple programs, but even artificial intelligence that is capable of self-learning are coming to the stock exchange.
However, if complex programs are affordable only by large hedge funds, banks and other large financial institutions, then simple software solutions such as scripts are affordable even by a student, and in basic cases you can find a script for your tasks completely free of charge.
A script is a program that is designed to perform a one-time action.
For example, if you have come across trading advisors, then you probably know that this program performs certain tasks as long as it is on the chart. The script differs from the advisor in that it is a one-time execution of the command while plotting it on the chart.
Thus, the script can perform the task that the advisor cannot handle. For example, if you want to close only profitable trades from your series of open orders, then when you apply the script to the chart, the program will close only profitable trades once, when the adviser does this constantly.
You need to set network of pending orders, delete unfilled orders or instantly close all transactions without unnecessary movements, or maybe turn the position over or open with a double lot?
All these simple tasks that we perform every day and which in turn take up our time can be easily automated using simple trading scripts. Analytical scripts allow you to conduct analytics in an accelerated manner.
For example, do you want to plot support and resistance levels, the Fibonacci grid or other elements of technical and graphical analysis? These kinds of scripts cope with these tasks.
Writing a script
In order to write your own script, you first need to decide on the task that it should perform. It is worth understanding that the task that the script performs must completely coincide with the action that you can perform manually or, more simply put, implement it yourself.
Having decided on a clear task and functions of the future script, the next step is its implementation. There are only two ways to implement or write your own script, namely, order development from specialists who understand programming or write it yourself through a special built-in editor in the Metaquotes trading terminal.
If you are knowledgeable in programming or have decided to write your first script using a tutorial, launch the editor using the special icon on the MT4 toolbar or by pressing the F4 key. After the editor appears in front of you in the upper left corner, click on the “Create” button.
A window will appear in front of you in which the editor will offer to create a type of program, namely an advisor, script, library, custom indicator and others. You need to select "Script".
After you select the type of program and click next, a new program window will appear in front of you, in which you will need to specify the name of your development and also add certain parameters.
After you click ready, the script will be automatically generated and appear in a text editor, in which you must directly implement your idea using special code.
Preparing a task for a programmer when creating a Script
A script, unlike an advisor, is an auxiliary program for manual trading, so its implementation does not take much time and effort from the programmer.
Before contacting a specific contractor, try to write clear terms and conditions, and do not hesitate to provide an illustration in the picture. You must clearly understand that a programmer is not a trader, so throw aside all your typical professional words like take a piece, knock out a moose, and the like. After you have formed a clear task, you need to negotiate the cost and timing.
You should clearly understand that a simple script contains a couple of lines of code and is a simple program, so you should not pay the same amount of money for it as you do with the development of an Advisor. In conclusion, I would like to note that scripts are very useful and popular programs, so they are quite often created by various traders and share their developments on Forex portals.
On our website you can also find a lot of useful scripts, so before ordering something, check if your idea has been implemented on the pages of our website. http://time-forex.com/skripty