Mql4 Lesson 5 Homework - Essay for you

Essay for you

Mql4 Lesson 5 Homework

Rating: 4.9/5.0 (34 Votes)

Category: Homework

Description

MQ4 to MQ5 converter - Please help!

Thread: MQ4 to MQ5 converter & Please help!

Forex Forum mt5.com – Introduction.
Forex market is high-yield and risky mean of taking profit by operations with the currency rates. Instruments of work at Forex market in many ways determine the result of currency trading made by Forex market participants – brokers’ clients. Every Forex broker offers its own terminal, however the most part of brokers and traders concur in choosing MetaTrader 4 and MetaTrader 5 terminals. This forum is created for those who prefer the terminal of MetaTrader series in trading on Forex.

Forex Forum mt5.com – trade discussion.
Forex market forecasts, independent opinions of novice traders and experts of the currency market – all this you will find at the Forex-forum of trades discussion. Solid experience of work on Forex is preferable, but all comers including Forex-newbies may come and share their opinion as well. Mutual help and dialog – the main goal of communication at Forex-forum, devoted to trading.

Forex Forum mt5.com – dialog with brokers and traders (about brokers).
If you have negative or positive experience of work with Forex broker – share it at Forex Forum, related to the questions of Forex service quality. You can leave a comment about your broker telling about advantages or drawbacks of work at Forex with it. The aggregate traders’ reviews of brokers constitute a rating. In this rating you can see the leaders and outsiders of the Forex services market.

Free discussions at the Forex Forum mt5.com
You are a trader and want to relax? Then Forex Forum for free discussions is for you. There are no doubts that conversation on subjects close to Forex market is preferential. Here you will find jokes about traders, caricature of Forex brokers and full-rate Forex off top.

Bonuses for communication at Forex Forum mt5.com
This forum is created by traders for traders and is meant for deriving of profit. However, each post at the Forex forum gives its author a forex bonus. which can be used in Forex trading at the account opened with one of the forum’s sponsors. This small gift is presented with the aim to reward professional traders for spent time at our forum.

We appreciate your choice of Forex forum mt5.com as a platform for communication.

All times are GMT +2. The time now is 06:52 AM .

Powered by vBulletin® Version 4.1.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Designed by Insta Media Group

Other articles

Converting from MQL4 to MQL5

Regular visitors will have noticed ever increasing amounts of spam on the Trading Gurus Community Forum. On November 24th 2012 we implemented some changes:

1. New users will be moderated 2. Registered users who have a post count of zero will not be able to view attachments or download code. 3. Registered users who have a post count of zero will not be able to create a new thread

As an additional countermeasure we anticipate introducing a modest paywall in the near future.

If this is your first visit here our apologies for the inconvenience.

Existing users may wish to contribute their ideas to this thread .

Results 1 to 10 of 12

Thread: Converting from MQL4 to MQL5

Administrator Join Date Apr 2010 Location South West England Posts 493

Converting from MQL4 to MQL5

I've copied this query here from the blog. The forum seems a more appropriate place to answer this sort of question:

I am new to MQL5 and am in the process of converting an MQL4 program to MQL5. Could you please direct me to how to retrieve a list of open orders in MQL5? Corresponding to the OrderFields in MQ4(OrderSymbol(). OrderType(), etc. Basically what has to be done to process the MQL4 parsing of orders used in the Select
ex

Thanks in advance,

Reality is merely an illusion, albeit a very persistent one - Albert Einstein

Hi, All!!
As my first contribution to the site, I am attaching the MQ5 version of the !xMeter Indicator, as well as my MQ4toMQ5 Conversion Script, with its .mqh Include files.

Thanks very much for what sounds like an extremely useful contribution to the MQL5 community codebase. I've just tried your converted MT5 xMeter indicator, and at first glance it looks like it does indeed do just the same job as the MT4 original.

Given where we seem to be heading, I've also changed the title of this thread!

Reality is merely an illusion, albeit a very persistent one - Albert Einstein

Junior Member Join Date Nov 2010 Location Balneario Camboriu, Brasil Posts 8

Quick observation;
The Pairs for establishing currency correlation are hardcoded in the !xMeter Indicator. Unfortunately, since MQ5 is still in demo, I have not been able to find a broker that includes all the currency pairs that are available on the MQ4 Platform. Therefore, you will need to change the !xMeter Indicator currency pairs that are available within your MQ5 platform. If you dont know how to do this, send me the list of MQ5 pairs offered by you Broker/Platform, so that I can send you the changes.

Junior Member Join Date Nov 2010 Location Balneario Camboriu, Brasil Posts 8

More Changes: 12/05/10
A: OutOfSequence Array was causing some entries to be missed.
B: Include "SetArrayAsTimeSeries" into OnCalculate for Indicators(As comments)
C: Final message indicating Program type converted.

I have resolved the RefreshRates issue and have incorporated the changes into the Conversion Program MQ4ToMQ5. Additional enhances have also been made.

Hi, All!!
As my first contribution to the site, I am attaching the MQ5 version of the !xMeter Indicator, as well as my MQ4toMQ5 Conversion Script, with its .mqh Include files. I have also included my "enhanced" version of the MQ4 !xMeter Indicator and !xMeter EA which I ran through the Conversion Script. Although 95% of the the !xMeter Indicator was converted correctly, changes to the x,y location of the various objects were made manually, given the fact that the Chart coordinate system origin seemed to have changed from MQ4 to MQ5.
The !xMeterEA.MQ5 is a Work-In-Progress, as I am new to OOPs, and need to get a better understanding of this environment. Be advised that this MQ5 EA does not have a clean compile as of yet. You will also notice that there are differences in the "Scoring" between the MQ4 and MQ5 !xMeter Indicators, which is, I believe, due to the fact that price data needs to be refreshed,i.e. RefreshRates() function, and this has not been worked out.
I decided to write my own conversion Script, as the one that keiji coded(mq4tomq5_script_sample.mq4 from http://www.dr-ea.com/meta-blog/ would not handle tabs and was a bit difficult to follow the logic. The MQ4toMQ5 will detect what type of program it is, without the need of specifying it in the input parameters. Furthermore, it is entirely "Table-Driven", so that addition of new "Words" as well as functions is easily accomplished.
I welcome any and all suggestions regarding improvements to any of the programs above, as well as assistance in the completion of the EA conversion.

==========Instructions for using the MQ4toMQ5 conversion Script==========
1. Copy !xMeter.mq4 and !xMeterEA.mq4 to MQ4\. \Experts\files Directory.
2. Copy and Compile MQ4toMQ5.mq4 to MQ4\. \Experts\Scripts Directory.
3. Run the MQ4toMQ5 Script on these programs to get the conversion output in the same Directory.
4. Transfer the output to the MQ5 Platform into their corresponding Directory.
5. Copy the Include Folder Files into the MQ5 Include Directory.
6. Compile the modules. (the !xMeter.mq5 that I have also included is ready to compile and run).

MQ4 MQ5 protection


You have produced the MQL4 or MQL5 codes that the whole world has been waiting for. You now want the whole world to use it but only if they have paid you for it. Whatever your distribution method, you need to protect your software from illegal copying and decompilation.

Jmi8.com provide you the best solution to protect your expert advisors and indicators !
  • It protects your EX4 files from the EX4-TO-MQ4 Decompiler.
  • It licenses EX4 or EX5 files so that will be bind to only one PC. (or 1 to 3 pc)
  • It provides time-limited licenses.

Step of Protect your ex4:

  1. Run ProtectEx4.exe we provided, it can protect all your indicators and expert advisors ex4 files to new ex4 files which can anti decompiler.
    First, press the right button "Browser. " of "Ex4 file to protect" to select your unprotect expert or indicator ex4.
    Then press the right button "Browser. " of "Output to filename" to save the protected ex4 file.
    You can continue browser another ex4 to protect.
    The protected ex4 can't be decompile for ever. You can download it to test. Download anti-decompile ex4 sample


  1. Make all encrypted ex4 files to a install program Setup.exe .
    You can make all the protected ex4 file to Setup.exe. The method to install ex4 to mt4.
  2. Send the Setup.exe and License Code to your user.
    You can send the Setup.exe and License Code to your customer. The license like this:
    Serial Number: JMI81-V2LZU-C159T-2E44B-DZWP8
    Password: MwONo4mxPz
    Or, you can put the Setup.exe on your web, let your users download it.
  3. Your user run the Setup.exe. it will auto install all ea ex4 files and indicators ex4 files and other files to proper directory of the MT system.
    When your customer run the Setup.exe, it will show the register window as below.
    They can just input personal information, or input nothing, and press Test. to test your ex4 for some days. You can set the trial days at a web manage console. If it is expired, the user will never can test it again.
    For your paid customer, they should input the Serial Number and Password you gave, and press Register .

You can tell me what register window you want to be, I can code it at the window for you.
for example,
the window's title,
the company and link information of yours ( to replace the link information of mine ),
shows or not show the personal input part,
uses or not use "Test" button function. The "Test" means "Demo".
the logo you want, you should send your logo file (*.ico) to me.

  1. You can set the time-limit at any time from a web-based admin console for your all or any users.
    You can manage your user by a web-based admin console. Like: http://jmi8.com/ensy/eManage.aspx
    You can press "Edit" at the left of every License Code to modify "Days Limit" and "Pc Limit". The pc limit can be 1-3, it means your user can install the ex4 files at 1-3 pcs. They can't install at other pc use the same license.

  1. If you want the ex4 to display the expiry date, so that your user can know when their license expired. You can add some code at your mq4 files. I will give the sample code to you.
    For example:
    Ret = GetExpieDate(Testlock);
    string Date_Limit="Expiration Date. " + DoubleToStr(Testlock[11]+2000,0) + "-"+ DoubleToStr(Testlock[12],0) + "-" + DoubleToStr(Testlock[13],0);
    ObjectDelete("Show_Date_Limit");
    ObjectCreate("Show_Date_Limit",OBJ_LABEL. 0, 0, 0 );
    ObjectSet ("Show_Date_Limit",OBJPROP_CORNER. 0);
    ObjectSet ("Show_Date_Limit",OBJPROP_XDISTANCE. 5);
    ObjectSet ("Show_Date_Limit",OBJPROP_YDISTANCE. 20 );
    ObjectSet ("Show_Date_Limit",OBJPROP_BACK. True );
    ObjectSetText("Show_Date_Limit", Date_Limit, 10, "Times New Roman", Yellow);

  1. If you have the source code to build your own DLL files, we can supply you with a kit (a .lib file) which you can add licensing checks to your dll.

MQL4 and MQL5 Cross Compiling on MetaTrader

MQL4 and MQL5 Cross Compiling on MetaTrader

There is a huge demand in converting mql4 to mql5 and mql5 to mql4 programs in Metatrader Platform. Currently no such utility is available for cross compiling and so far only manual coding is involved in converting mql4 to mql5 and mql5 to mql4 indicators and expert advisors.To solve this complexity Metaquotes had come up with a solution in so that MT4 and MT5 platforms comes to a convergence point.

Here are some of the Big Changes announced by metaquotes recently.

1)Complete replacement of MQL4 language and MetaEditor 4 with common MQL5 and MetaEditor components


To achieve this, we have developed a unified compiler that automatically supports both MQL4 and MQL5 languages. MetaEditor will also become a single application both for MetaTrader 4 and MetaTrader 5 platforms. Thus, it will be possible to compile both MQL4 and MQL5 from any version.

2)MQL5 Storage will be available in MQL4 ID E

Thus, it will be easier to manage source code versions, participate in team operations and synchronize files.

3)MQL4 code protection is considerably increased

New EX4/EX5 files are provided with a serious and completely revised protection.

4)The market of applications will become available in MetaTrader 4

Transition to the new compiler that supports resources and conventional protection suited for each user’s PC will allow users to develop and sell full-fledged applications. There is no need to worry about the protection of EX4/EX5 files sold via the market – they do not contain bytecode but only a pure native code signed by our private key.

This solution puts in order all the diversity of existing programs and protects the sellers.

5)The market of MetaTrader 4 applications will open for MQL5.community in mid-August

Developers already can prepare their applications and register as sellers. We will start releasing the first beta versions of the terminal in a couple of weeks.

With demand for its MetaTrader 4 platform to remain strong, despite the launch of the MetaTrader 5 system, MetaQuotes announced last month that it was working on creating greater adaptability between the MQL4 and MQL5 languages that power automated trading on the two platforms. According to MetaQuotes, the company decided to boost the abilities of MQL4 by adding programming features from MQL5.

Last month MetaQuotes has announced the launch of the beta IDE, for cross compiling of MQL4/5 programs. To adapt with the new features, several segments of the existing MQL4 language will no longer be accepted code. The new IDE is currently available for download on the MQL4 forum site (link here ). During the beta period, MetaQuotes will be monitoring for bugs before a complete rollout of the compiler to all MetaTrader 4 platforms.

With the changes set to take place, developers will have greater abilities to create EAs and indicators to work across both MetaTrader 4 and 5. Not surprisingly, the MQL evolvement occurs as MetaQuotes is also in the process of launching its MQL4 marketplace. where developers can sell EAs for the MT4 platform to fellow users.

Future Boost for MT5?

One of the key items holding MT5 back from gaining widespread adoption, was the changes between MQL4 to 5. Rather than being simply a platform upgrade, the core of each platform was different. As a result, programs available for MetaTrader 4 wouldn’t work on MetaTrader 5. This in turn created little reason for traders and developers to move to the new platform. Without client demand, brokers have seen little reason to launch MT5, even with its server side benefits it provides. However, this dynamic could be changing soon. By creating cross language constants, and a common compiler, MetaQuotes should have an easier time marketing MT5, as products developed using the new MQL4 IDE are expected to be compliant with the MQL5 code.

While the future for MT5 looks brighter, there is a chance for these new changes to back fire. In terms of MetaTrader, a chief complaint has been the lack of uniformity between the two platforms. Even with the new IDE, developers need to update their MQL4 programs in order to adapt it to changes. As such, it could alienate users of older programs, who may decide that if they are already going through the process of recoding, then it is worth looking into other platforms as well.

Source. MQL4 and MQL5 Slowly Merging on MetaTrader

Related Readings and Observations About Rajandran

Rajandran is a Full time trader and founder of Marketcalls, hugely interested in building timing models, algos. discretionary trading concepts and Trading Sentimental analysis. He now instructs users all over the world, from experienced traders ,professional traders to individual traders.

Rajandran attended college in the Chennai where he earned a BE in Electronics and Communications. Rajandran has a broad understanding of trading softwares like Amibroker, Ninjatrader, Esignal, Metastock, Motivewave, Market Analyst(Optuma),Metatrader,Tradingivew,Python and understands individual needs of traders and investors utilizing a wide range of methodologies.

Sir I would like to know how can one install .ex4 file in mt4. I m copying it in experts indicators still m not able to get the indicator what could be the problem. M jus not able to see that code base whn I open the software in custom indicators plz help.
Thank you

ex4 is of two types. It could be indicator or expert advisors. If it is indicator then place the file under experts/indicator folder. if it is expert advisor then place the file at /experts folder.

anirban debnath says

Required US Government Disclaimer & CTFC Rule 4.41

​Futures trading contains substantial risk and is not suitable for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only consider risk capital that should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. CTFC RULE 4.41 – HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS SUCH AS LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN. All trades, patterns, charts, systems, etc. discussed in this website or advertisement are for illustrative purposes only and not construed as specific advisory recommendations. All ideas and materials presented herein are for information and educational purposes only. No system or trading methodology has ever been developed that can guarantee profits or prevent losses. The testimonials and examples used herein are exceptional results which do not apply to average people and are not intended to represent or guarantee that anyone will achieve the same or similar results. Trades placed on the reliance of Trend Methods systems are taken at your own risk for your own account. This is not an offer to buy or sell futures interests.

© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved · And Our Sitemap · All Logos & Trademark Belongs To Their Respective Owners·

Data and information is provided for informational purposes only, and is not intended for trading purposes. Neither marketcalls.in website nor any of its promoters shall be liable for any errors or delays in the content, or for any actions taken in reliance thereon.

MQL4 Development Home Penguin Traders

@zelo that looks really cool by the way! I have tried ZeroMQ and it worked pretty well. But i found creating a simple http server in Node.js to be the easiest and it would also be easier for anyone who want to setup your app. Because even if you use ZeroMQ or anything else, you would still need to check some sort of a queue with the way MT4 works.… [Read more]

@Saver0. I like Node.js too. I think about send data lile ohlc and indicator data from MT4 to our app
would be easier than connecting Oanda. I looked into your code and it pretty complicated
Is there any simpler way :-D

@zelo It shouldn’t be too complicated if you take a look at it. I may have over complicated it. Like smallcat said, it’s just that one function call that’s doing all the work. You can send the data to Node.js in any format you want. I just prefer it to be in JSON so it can be easily parsed. I send the data with a command in the first few strings… [Read more]

@Saver0 I know about Oanda Api. It is really good. I am biased on Oanda too.

There is a problem with the chart app in the picture above. I can not draw trend line and get information about a candle
because of CSS positioning, I can not get exact mouse position, LOL
If i want to, i have to rewrite code in SVG.

So I will keep thing simple,… [Read more]

@Zelo Yea, I’m biased against all Brokers to be honest. haha just use what is available to me.
As for the trend lines, maybe try to keep the charts simple? It doesn’t have to be 3D looking If I can see 4small 600×400 windows with 4 time frame charts, on a 2×2 grid running synchronized, I would be happy

@saver0. from the mql file we can see “if(!INet.Request(“POST”,”/”,data,false,false,req,false)) ” and “if(!INet.Request(“POST”,”/”,incoming_msg,false,true,req,false))”. the string variable “data” and “incoming_msg” are to hold the return value sent by NodeJs, and we use jsonParser to get the ‘direction’ of the signal.


Disclaimer: By using this site you agree that any Advice or information on this website is General Advice Only. You also agree that you will not hold any person or entity responsible for loss or damages resulting from the content posted here on PenguinTraders.com. All downloadable content on this site is offered with no warranty or guarantees and you are solely responsible and will not hold any person or entity responsible for the loss or damages that you may incur.

High Risk Warning: Forex, Futures, and Options trading has large potential rewards, but also large potential risks. The high degree of leverage can work against you as well as for you. You must be aware of the risks of investing in forex, futures, and options and be willing to accept them in order to trade in these markets. Forex trading involves substantial risk of loss and is not suitable for all investors. Please do not trade with borrowed money or money you cannot afford to lose. Any opinions, news, research, analysis, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. We will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from the use of or reliance on such information. Please remember that the past performance of any trading system or methodology is not necessarily indicative of future results.

Penguin Traders © 2017. All Rights Reserved.