कमाएं तक राशि
$ 50 000
दोस्तों को आमंत्रित करने के लिए
इंसटाफोरेक्स से स्टार्टअप बोनस प्राप्त करने के लिए
निवेश की आवश्यकता नहीं है!
के नये स्टार्टाप बोनस के साथ कोई
भी जोखिम और जमा के बिना
व्यापार शुरू करें
बोनस 1000$
GET BONUS
55%
from InstaForex
on every deposit
+ Reply to Thread
Page 6 of 6 FirstFirst ... 4 5 6
Results 51 to 57 of 57

Thread: Convert MT4 to MT5

  1. #51
    Senior Member rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz's Avatar
    Join Date
    Sep 2017
    Location
    multan punjab pakitan
    Posts
    1,042
    Accumulated bonus
    407.40 USD
    Thanks
    9,036
    Thanked 7,539 Times in 1,080 Posts
    yes sir apne theek kehra hy hain forex ye is mt4 or mt 5 k bina achi treding krna mushkil ha bulky na mumken ha ye kaho ga k me ne to mt4 achi tarah ues kia ha or mt 5 ko bilkul ues ni kia ha mujy koi tajerba ni kia ha
    WE LOVE INDIAN-FOREX FORUM AND INSTA FOREX BROKER

  2. Device
  3. The Following 11 Users Say Thank You to rehanayaz For This Useful Post:

    Abniali05 (10-26-2017), Aliakbar2016 (10-28-2017), billyboy00007 (10-26-2017), FOREXMAN (10-27-2017), ghaffar500 (10-26-2017), incomejobs (10-26-2017), jellybelly2017 (10-29-2017), munibkhan (10-27-2017), sufiyan22 (10-29-2017), yulbang111 (10-26-2017), zahid2016 (10-28-2017)

  4. #52
    Member mido83 is on a distinguished road mido83's Avatar
    Join Date
    Oct 2017
    Posts
    354
    Accumulated bonus
    22.91 USD
    Thanks
    23
    Thanked 50 Times in 46 Posts
    Much thanks to you for your accommodating written work , I didn't know before your tone , despite the fact that I am not master on PC but rather I am attempting to heard to know more . As a matter of fact this marker is helpfull for me, completely its style is better other pointer.

  5. #53
    Senior Member rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz has a reputation beyond repute rehanayaz's Avatar
    Join Date
    Sep 2017
    Location
    multan punjab pakitan
    Posts
    1,042
    Accumulated bonus
    407.40 USD
    Thanks
    9,036
    Thanked 7,539 Times in 1,080 Posts
    Sarji Mere Khayal Se Forex trading Mein metatrader 4 all metatrader 5 sem Hai To Mai Ye kahunga ke agar aap metatrader 5 ko Choos karte hain toh Wo bhi bilkul same hai metatrader 4 Ki Tarah aur usne aapko Ye dekhna Hoga Ki integrated kaise hain Humko select Kya Kiya Jata Hai Mera experience Hai Ke
    WE LOVE INDIAN-FOREX FORUM AND INSTA FOREX BROKER

  6. The Following 7 Users Say Thank You to rehanayaz For This Useful Post:

    ayazfx (12-17-2017), danish555 (12-16-2017), FOREXMAN (12-19-2017), fxearner (12-13-2017), India148 (12-16-2017), jellybelly2017 (12-16-2017), KASINA (12-24-2017)

  7. #54
    Junior Member rehanayaz2 is on a distinguished road rehanayaz2's Avatar
    Join Date
    Dec 2017
    Posts
    62
    Accumulated bonus
    3.70 USD
    Thanks
    426
    Thanked 54 Times in 24 Posts
    Jee bilkul Mere Khayal Se Forex trading Mein Yeh mql software jo hai bilkul metatrader 4 on metatrader 5 Ki Tarah hai aur aap ko PC me install Karke integrator use kar sakte hain Yeh Bhi aapko integrate karta hai

  8. The Following User Says Thank You to rehanayaz2 For This Useful Post:

    fxearner (12-27-2017)

  9. #55
    Junior Member BoogeY 992 is an unknown quantity at this point BoogeY 992's Avatar
    Join Date
    Jan 2018
    Posts
    19
    Accumulated bonus
    0.00 USD
    Thanks
    11
    Thanked 3 Times in 3 Posts
    The global economy is expected to be driven by higher commodity prices which should support commodity currencies such as the Australian, New Zealand and Canadian Dollars. Additionally, an expected outflow of capital from the U.S. is likely to weigh on the U.S. Dollar. In other words, the strengthening of the global economy should limit the U.S. Dollar's gains and eventually drive it lower.

  10. #56
    Junior Member BoogeY 992 is an unknown quantity at this point BoogeY 992's Avatar
    Join Date
    Jan 2018
    Posts
    19
    Accumulated bonus
    0.00 USD
    Thanks
    11
    Thanked 3 Times in 3 Posts
    The GBPUSD pair spent most of the month of December in a tight range as the prices consolidated between 1.3200 and 1.3500 for much of the month.

  11. <a href="https://www.instaforex.com/company_news">&#1060;&#1086;&#1088;&#1077;&#1082;&#1089; &#1087;&#1086;&#1088;&#1090;&#1072;&#1083;</a>
  12. #57
    Junior Member Iqra18 is an unknown quantity at this point Iqra18's Avatar
    Join Date
    Jan 2018
    Posts
    17
    Accumulated bonus
    0.00 USD
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Open the source file “MQL4\Experts\Moving Average.mq4” in MetaEditor 4 and select and copy all text (Ctrl + A, Ctrl + C). You can open the MetaEditor 4 by pressing the F4 key when the MT4 client terminal is open.
    2.It is assumed that you have downloaded the MT5 desktop terminal from your preferred broker. Open the instance of the MT5 client and open MetaEditor 5 to create a new EA (template).




    3.Assign a name to your EA template by filling the “Name” field. For example, you can use the name “SimpleEA” or simply name the file with something else. See the snapshot below:



    After completing this action, you will get the template for your future EA to be built on MT5.
    4.Select all text (Ctrl + A) on the template and delete them all, then paste (Ctrl + V) recently copied text from MetaTrader 4 as shown in the image below:



    You will get something like what is shown in the snapshot below:



    MetaTrader 5 has other orders system (select, send, open, close…) methods, but in order to use the simplest method of conversion from MT4 to MT5 EA, it is better to use one library – mq4.mqh. This library allows the programmer or user to work with the orders in MQL5 (such as the MT5-hedge) in the same way as in the MQL4. In other words, the library enables the order language system (OLS) to become identical to MQL4.

    This library covers only the order systems. The mq4.mqh library file is available from selected programmers online. The one used in this example has been obtained from a programmer and a little functionality added, and all these have been combined into a single file.
    5.Make sure an instance of the MT5 platform is open. Once you have your MT5 platform open, you can then click on File -> Open data folder ” ……\MQL5\Include” and drop the library file (mq4.mqh) file to the folder.




    6.Refresh the MT5 platform by closing it and opening it again, then open MetaEditor5. Open the source code of the expert advisor and in the source code of SimpleEA.mq5 add the string: #include <mq4.mqh>


    7.Once you have added the string to the source code, you can compile the updated source code of SimpleEA.mq5 by just pressing the “F7” button, or you can press the button which says “Compile” on the ToolBar of the MetaEditor 5:



    You will get only 2 errors after compilation:



    This also highlights another difference between the MT4 and MT5 platforms, and that is the differences in the indicator’s calls.
    •In MetaEditor 4, you just write iMA(symbol,timeframe,”settings ma”, shift), where “shift” is a number of a price candle, example 0, last candle on the chart and iMA() is the return value of moving average on 0-candle.
    •On MetaEditor5 you need to create handles for each indicator or EA and functions for getting value from the EA or indicator by this handle.

    Changing the MT4 Source Code to a Workable MT5 Version: Step-by-step Guide

    This brief section explains what you need to add the source code for MT4 to make it work in MT5. These changes apply only to the indicator. In other words, you need to change only one line in the source code.

    Change from:

    ma=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PR ICE_CLOSE,0);

    to:

    int OnInit()
    {
    MAHandle = iMA(NULL, 0, MovingPeriod, MovingShift, MODE_SMA, PRICE_CLOSE);
    if(MAHandle == INVALID_HANDLE)
    {
    Print(“Error creating MA indicator”).

    The steps in conducting these changes are now described below:
    1.To begin, you have to create a variable Integer (int) type for MA-indicator handle and assign it a value known as INVALID_HANDLE. This is demonstrated below:

    int MAHandle = INVALID_HANDLE;



    Expert advisors and indicators have an OnInit() section for initializations in runtime. It has the form:

    int OnInit()
    {
    // your code here
    return(INIT_SUCCEEDED);
    }

    You can read about this using the Help File. The Help File on MetaEditor5 is accessed by pressing the “F1” key. The MQL5 Community website also has a document which shows a lot of information that can be found in the Help File. This document can be accessed using this link:

    https://www.mql5.com/en/docs/basis/function/events
    2.The next step is to add this code into the text (that is, the source code) of our EA, if this section does not exist (press Alt + M from MetaEditor 5).



    In the list of functions, we can see that there are 5 functions. However, the OnInit() function doesn’t exist by default, therefore we have to create it by ourselves by writing it manually. This is shown in the image below.



    You can press (Alt + M) on your computer keyboard so you can see the OnInit() function added to the source code.


    3.In section OnInit(), you can write the following code:

    MAHandle = iMA(NULL, 0, MovingPeriod, MovingShift, MODE_SMA, PRICE_CLOSE);
    if(MAHandle == INVALID_HANDLE)
    {
    Print(“Error creating MA indicator”);
    return (INIT_FAILED);
    }



    Usually, in the MT4 MetaEditor, you would be required to write the code like this:



    However, for the MT5, the code is written as a handle for an indicator. Therefore in MT5, you write the code as follows:


    4.In the next step, you will need to write a function to get value from Moving Average EA by using the handle shown in the image below:



    We mentioned earlier that you need to create a function for getting value for the indicator or EA when using the MetaEditor5. The Function for getting values contains a string known as CopyBuffer(). The CopyBuffer copies data from indicator to your array. CopyBuffer gets data of a specified buffer of a certain indicator in the necessary quantity. You can get more information about CopyBuffer by reading the document available on this link:

    https://www.mql5.com/en/docs/series/copybuffer

    The code is written below as follows:

    CopyBuffer( indicator_handle
    [in] The indicator handle, returned by the corresponding indicator function.
    buffer_num
    [in] The indicator buffer number.
    start_pos
    [in] The position of the first element to copy.
    count
    [in] Data count to copy.
    buffer[]
    [out] Array of double type.
    )

    MA has 1 buffer which is numbered “0”. You need to copy one value from MA.

    In the MT4 MetaEditor, this is written as follows:



    The last “0” corresponds to the value of MA on the zero candle (the last candle on the chart).

    In the MT5 MetaEditor, this is written as follows:



    Copy one value, from index position to the MA array
    5.We now move to clear the 2 errors initially shown when compiling the code. You start this process by double clicking on the first record error as shown in the image below.



    …..and you will be moved to where the error is located in the MT5 source code for your EA. The error code is located on line 114 for this example. See image below:



    The line in the source code which contains this error has to be deleted and replaced with a string that contains the MaGet(0) code. This is illustrated in the image below. Notice that the error code is underlined in red ink, and the ma MaGet(0) code which is used to replace it is shown underneath.



    Once you have replaced the error code with the MaGet(0) string, you can compile the code once more by pressing the F7 key. When the source code is recompiled, we see that only one error remains as shown below:



    In order to replace the remaining error code, we go through the same sequence we used in clearing the first error code. Double click on the line containing the error code (i.e. on line 140 for this example), comment and replace as shown in the image below.



    Again, the error code is underlined with green ink, and the string under it shows the code to be used to replace it and effect the correction of the error.



    The string used for this replacement is:

    if (Open[1]>MAGet(0) && Close[1]<MAGet(0)

    Once you have commented and replaced the error code, you have to recompile the code. So once more, you compile the source code by pressing the F7 key on your computer keyboard to do this. You can see then that all errors have been taken care of. Zero errors in the code, as shown in the image below:



    This snapshot below shows the difference between the MT4 and MT5 source codes for indicator calls and the conversion process from MT4 to MT5.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts