BUY FXO Forum Shares
1316
Shares in the BANK:
We BuyWe Sell
$1.8211$1.8774
Results 1 to 6 of 6

Thread: welcome to MQL4

  1. #1
    Bullish
    Join Date
    Apr 2008
    Posts
    78
    FXO Shares
    0
    FXO Bonus
    0.000
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    welcome to MQL4

    Welcome to the MQL4 course.
    In this series, I will try to strip the mystique and confusion from MQL4 by giving you comprehensive tutorials with a straight forward example.

    In this series of lessons, I will show you how to use the MQL4 for building your own Expert Advisors, Custom Indicators and Scripts




    If you are programming in C (or its superset C++) then you know a lot of MQL4 before even I start my lessons, if you didn’t write in any programming language before, no problem, I’ll guide you to understand the concept of programming in general as well.

    So, let’s start from the beginning.

    MQL4? What, Why and Where?

    MQL4 stands for MetaQuotes Language 4.
    MetaQuotes is the company who built the MetaTrader Trading Platform.
    And to make it stronger than the other trading platforms the company extended it by a built-in programming language that enables the user (you) to write his own trading strategies.

    The language enables you to create one of the following:

    1- Expert Advisors.
    2- Custom Indicators.
    3- Scripts.

    • Expert Advisor is a program which can automate trading deals for you. For example it can automate your market orders, stops orders automatically, cancels/replaces orders and takes your profit.

    • Custom Indicator is a program which enables you to use the functions of the technical indicators and it cannot automate your deals.

    • Script is a program designed for single function execution. Unlike the Advisor, scripts are being held only once (on demand), and not by ticks. And of course has no access to indicator functions.

    These were “What” MQL4 is? “Why” to use MQL4?
    Now, “Where” do I write MQL4?

    To write your MQL4 code and as anything else in world, you can choose one of two ways, the hard way and the easy way.

    1- The hard way:

    The hard way is using your favorite text editor and the command prompt to compile your program.
    Notepad is not bad choice, but do not forget two things:

    1- To save the file you have created in plain text format.
    2- To save the file as .mp4 (that’s to be easy to reopen it with MetaEditor), but you can save it as any extension you prefer.

    After saving your program there is an extra step to make your code comes out to the light.
    It’s the Compiling step.
    Compiling means to convert the human readable script that you have just wrote to the machine language that your computer understands.

    MetaTrader has been shipped with its own compiler (the program which will convert your script to the machine language) called MetaLang.exe.

    Metalang.exe is a console program which takes two parameters and output an .ex4 file (the file which Metatrader understands).
    The first parameter is “options” parameter and the only option available is –q quit
    The second parameter is the full path to your .mql file.

    The syntax will be in this format.
    metalang [options…] filename

    Example:

    1- Find your metalang.exe path, it will be the same path of MetaTrader (here my path is D:\Program Files\MetaTrader 4).

    2- Create a batch file and name it compile.bat (or any name you prefer).

    3- Write these lines into the bat file then save it:
    cd D:\Program Files\MetaTrader 4
    metalang -q "D:\Program Files\MetaTrader 4\my_first_mql4_script.mq4"
    (Don’t forget to change the path to you MetaTrader installed path).

    4- Run the batch file and if you are lucky person like me you will get a screen like figure 1.





    Figure 1 Metalang compiler

    As you see you will get the output file “my_first_mql4_script.ex4”

    2-The easy way:

    Metatrader has been shipped with a good IDE (integrated development editor) called MetaEditor which has these features:

    1- A text editor has the feature of highlighting different constructions of MQL4 language while you are writing/reading code.

    2- Easy to compile your program, just click F5 and the MetaEditor will make all the hard work for you and produces the “ex4” file.
    Besides it’s easy to see what the wrong in your program is (in the Error Tab – see figure 2).

    3- Built-in a dictionary book which you can access by highlight the keyword you want to know further about it then press F1.





    Figure 2 MetaEditor 4

    In the coming lessons we will know more about MetaEditor.

    Today I just came to say hello, tomorrow we will start the real works and will study the Syntax of MQL4.

    I welcome very much the questions and the suggestions

  2. #2
    Bullish one's Avatar
    Join Date
    May 2008
    Posts
    90
    FXO Shares
    0
    FXO Bonus
    0.000
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    is this course for make mql file???

  3. #3
    In Profit
    Join Date
    May 2008
    Posts
    111
    FXO Shares
    0
    FXO Bonus
    0.000
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    same question with mr one...
    anybody can translate in indonesian language???
    join with fxpeace, get cash rebate $8/lot
    -open here-

  4. #4
    In Profit
    Join Date
    Aug 2007
    Posts
    103
    FXO Shares
    0
    FXO Bonus
    0.000
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by fxpeace View Post
    same question with mr one...
    anybody can translate in indonesian language???
    yeah its hard to find mql language courses in languages other than english

  5. #5
    Piplet manzaipoh's Avatar
    Join Date
    Oct 2008
    Posts
    5
    FXO Shares
    0
    FXO Bonus
    0.000
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    is this thread still active?

  6. #6
    In Profit
    Join Date
    Jan 2009
    Posts
    103
    FXO Shares
    0
    FXO Bonus
    0.000
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hmmm where is thread starter??

    deskribe more about this....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Disclaimer
2005-2017 © FXOpen All rights reserved. Various trademarks held by their respective owners.

Risk Warning:: Trading on the Forex market involves substantial risks, including complete possible loss of funds and other losses and is not suitable for all members. Clients should make an independent judgment as to whether trading is appropriate for them in the light of their financial condition, investment experience, risk tolerance and other factors.

FXOpen Markets Limited, a company duly registered in Nevis under the company No. C 42235. FXOpen is a member of The Financial Commission.

FXOpen AU Pty Ltd., a company authorised and regulated by the Australian Securities & Investments Commission (ASIC). AFSL 412871ABN 61 143 678 719.

FXOpen Ltd. a company registered in England and Wales under company number 07273392 and is authorised and regulated by the Financial Conduct Authority (previously, the Financial Services Authority) under FCA firm reference number 579202.

FXOpen does not provide services for United States residents.

Join us