NavigationUser loginWho's new
Who's onlineThere are currently 0 users and 63 guests online.
|
First session Installing MQL4 programs!Hi folks, One of the most important features of MetaTrader is the ability to write your own programs and attach them to MetaTrader terminal. Programs includes Indicators , Expert advisors , Scripts and Libraries. These programs written in a programming language called MQL4 and can be used in MetaTrader by proper installing. Today we are going to study how to install these program to use them in MetaTrader. Format:There are two kinds of files that you'll use with MetaTrader; the programs files and the executables files. The program files are normal text files but have one of these extensions: .mq4 and .mgh. The executable files are binary files (you can't open them for viewing or editing) and has the extension .ex4. Note: the .mgh files are header files which mean they have line of codes and the MQL4 programmer can include them in his MQL4 programs. So they couldn't be compiled to .ex4 files.
Compiling:Compiling is an operation taken by a special program (called a compiler) to convert from text (readable) format to the binary format which the computer can understand (computers think in binary). This is the general definition of compiling. Compiling in our case is converting the mq4 files to ex4 for file using MetaEditor program. To do that we simply open the mq4 files in MetaEditor then pressing F5 hot key. We compile the mq4 files because the MetaTrader can't load any files except ex4 files. So, when we get the mq4 files and compile them, does it mean we've finished installing them and ready to use them? Note: it's recommended to take the folder step before the compiling step that's because the compiler will place the ex4 file at the same place as the mq4 files.
Folders:You knew that there are four kinds of MetaTrader programs; expert advisors, indicators, scripts, libraries, besides the header files (.mgh files). MetaTrader is very tidy program and he set a folder for each type of programs and he expects that you are a tidy trader and will place every program in its proper folder. MetaTrader search the folder of the experts for the experts and the folder of indicators for the indicators etc. So, you have to place the source code of the expert advisors in the folder of the expert advisors and use MetaEditor to compile them to generate ex4 files in the expert advisors folder. The same with the indicators, the scripts and the libraries. These are the folders used: Expert advisors folder: MetaTrader_Dir\experts Indicators folder: MetaTrader_Dir\experts\indicators Scripts folder: MetaTrader_Dir\experts\scripts Libraries folder: MetaTrader_Dir\experts\libraries Include folder (mqh files) MetaTrader_Dir\experts/include
I hope installing MetaTrader programs now is an easy task and if you have any question please don't hesitate to ask! Coders Guru!
|