• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 9:58pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 9:58pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Need help to fix mql5 library to work properly on mql4 2 replies

Need help converting mql4 to mql5 0 replies

Need help to convert simple TradeStation Indicator to mt4 2 replies

Convert MQL5 Indi to MQL4 0 replies

any idea how to convert mql5 to mql4? 5 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 43
Attachments: Need help to convert simple MQL4 indicator to MQL5
Exit Attachments
Tags: Need help to convert simple MQL4 indicator to MQL5
Cancel

Need help to convert simple MQL4 indicator to MQL5

  • Last Post
  •  
  • Page 1 2 3
  • Page 1 2 3
  •  
  • Post #1
  • Quote
  • First Post: Mar 11, 2014 8:07pm Mar 11, 2014 8:07pm
  •  skenobi
  • Joined Oct 2007 | Status: Former institutional dogsbody | 1,253 Posts
First some disclaimers:

  1. My MQL4 coding experience is limited to cannibalizing bits and pieces of other peoples' code for use in my own little indicators. Somehow this has worked for me for the past 5 years or so.
  2. I have never coded C/C++, which I understand is similar to MQL5. The only language I was ever proficient in was Tradestation's EasyLanguage back in the day.

I'm trying to get my head around coding for MQL5, and need help to convert the attached sample MQL4 indicator to MQL5 as a starting point for me in the learning process.

All the indicator does is the following:

  1. print the number of minutes of each timeframe in the top left hand corner of the chart e.g. in the Daily chart it will print 1440, in the H4 chart 240 etc etc.
  2. print an arbitrary historical reference price in the bottom left corner of the chart for the currency pair I'm looking at. e.g. for USDJPY it will print 100, for EURUSD 1.2000. All these levels are already arbitrarily fixed in the body of the code itself, so there's no calculation at all.

All in all, a pretty stupid (but little and simple enough) indicator I've cooked up. But it's my first tiny step in understanding MQL5.


The code compiles easily in the latest MT4 updates. I just need a working MT5 version that compiles fully, error-free and if possible, warning-free as well.

Yes I know there are "better" ways of learning a new language, but would appreciate you could just humor me with my humble request!

Many thanks in advance!

Cheers!
Skenobi

Attached File(s)
File Type: mq4 TF label.mq4   4 KB | 953 downloads
I'm not trying to convince anyone. I'm not in the "convincing" business.
  • Post #2
  • Quote
  • Mar 12, 2014 3:44am Mar 12, 2014 3:44am
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Just to understand you right:
are you asking for the equivalent of your code for the mt5 platform?
Or is it for the new mt4 builds with the updated mql4?
..
 
 
  • Post #3
  • Quote
  • Mar 12, 2014 3:56am Mar 12, 2014 3:56am
  •  skenobi
  • Joined Oct 2007 | Status: Former institutional dogsbody | 1,253 Posts
Quoting rockit
Disliked
Why is it a problem for you? There's the documentation with sample code (I guess). Changes are minor, of mostly 'cosmetic' nature; and no, you do not need to know c++, it is in no way mandatory (i.e. for the domain specific part of mql), just an extention. Anyway basic OOP is trivial..
Ignored
Thanks for your response!

There are at least a handful of reasons it's somewhat of a problem for me:

  1. The sample codes I have come across involve calculations e.g. calculations of MAs, stochastics etc etc. My request only involves "positioning" (for lack of a better word) of particular artifacts, and there aren't any (?) examples of these that I can find.
  2. .... and I can't seem to get my code to work even after following step-by-step the (probably less-than-adequately-translated) English translation of the original Russian text.
  3. The examples almost always require the use of 'include' files to facilitate the "emulation" (again, dunno if I'm using the correct term) of MQL4. I'd prefer to port to pure MQL5 if at all possible. (If not possible, then I'd still accept any help I can get.)

I think once I can get the hang of where every component belongs and how they work (e.g. all the init, deinit, start sections and even how oncalculate works despite there being no calculation in my simple example (?) ), I could speed up my learning process!

Again, thanks very much for your views!

I'm not trying to convince anyone. I'm not in the "convincing" business.
 
1
  • Post #4
  • Quote
  • Mar 12, 2014 3:59am Mar 12, 2014 3:59am
  •  skenobi
  • Joined Oct 2007 | Status: Former institutional dogsbody | 1,253 Posts
Quoting rockit
Disliked
Just to understand you right: are you asking for the equivalent of your code for the mt5 platform? Or is it for the new mt4 builds with the updated mql4?
Ignored
My sample code already compiles with the new MT4 builds, and I have no problem with the new MT4 builds so far as I have managed to port most of the indicators I use regularly from b509 to b600+.

My new aim now is to be able to port everything to MT5.

Hope that is clear!

Thanks again!
I'm not trying to convince anyone. I'm not in the "convincing" business.
 
 
  • Post #5
  • Quote
  • Mar 12, 2014 12:40pm Mar 12, 2014 12:40pm
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Yes, now clear.


Attached File(s)
File Type: mq5 TF label.mq5   4 KB | 836 downloads
..
 
 
  • Post #6
  • Quote
  • Mar 12, 2014 8:26pm Mar 12, 2014 8:26pm
  •  skenobi
  • Joined Oct 2007 | Status: Former institutional dogsbody | 1,253 Posts
Quoting rockit
Disliked
Yes, now clear. {file}
Ignored

rockit, you ROCK!

Thanks HEAPS for the MQL5 sample!
I'm not trying to convince anyone. I'm not in the "convincing" business.
 
 
  • Post #7
  • Quote
  • Jun 1, 2014 3:34pm Jun 1, 2014 3:34pm
  •  lucacol
  • | Joined Sep 2013 | Status: Member | 37 Posts
Hi, it's possible to convert this indicator in mq5?

Thanks
Attached File(s)
File Type: mq4 SweetSpots.mq4   4 KB | 561 downloads
 
 
  • Post #8
  • Quote
  • Jun 1, 2014 10:16pm Jun 1, 2014 10:16pm
  •  Gvc
  • Joined Jun 2010 | Status: Member | 1,501 Posts
I found this on the net.....Not sure how good it is.....

Looks like once converted you will still need to fix errors.......

http://www.fx1618.com/mt5/mql4-to-mql5.html
 
 
  • Post #9
  • Quote
  • Jun 3, 2014 3:42pm Jun 3, 2014 3:42pm
  •  lucacol
  • | Joined Sep 2013 | Status: Member | 37 Posts
Thanks, I tried to convert, but I can't fix the error, beacuse I don't know the programming code.

Can anybody help me?
 
 
  • Post #10
  • Quote
  • Jun 3, 2014 3:55pm Jun 3, 2014 3:55pm
  •  fxdaytrader_
  • Joined Jan 2011 | Status: UberTroll | 1,847 Posts
not sure, maybe using the build 509 compiler will work? -> http://www.forexfactory.com/showthread.php?t=470340
PM me with coding requests and I'll probably put you on my ignore list
 
 
  • Post #11
  • Quote
  • Jun 29, 2014 10:23am Jun 29, 2014 10:23am
  •  lucacol
  • | Joined Sep 2013 | Status: Member | 37 Posts
Hi, thanks for the link, I tried, but gives me the same errors... UFF...
Do not open it with MT5.
 
 
  • Post #12
  • Quote
  • Nov 8, 2014 1:38pm Nov 8, 2014 1:38pm
  •  sorsen
  • | Joined Dec 2009 | Status: Member | 17 Posts
Hi, it's possible to convert this indicator in mq5?

Thanks
 
 
  • Post #13
  • Quote
  • Nov 14, 2014 10:32am Nov 14, 2014 10:32am
  •  sorsen
  • | Joined Dec 2009 | Status: Member | 17 Posts
Hi, it's possible to convert this indicator in mq5?

Thanks
Attached File(s)
File Type: mq4 Givonly_SnR_SnD_r2 .mq4   9 KB | 612 downloads
 
 
  • Post #14
  • Quote
  • Mar 27, 2015 10:47am Mar 27, 2015 10:47am
  •  UnexpCoder
  • | Joined Feb 2015 | Status: Member | 3 Posts
Hi guys
can some help me convert this EA into MQL5 script i can use in another MQ5 EA. Also please replace the adjusted stop loss with Moving Average trailing stop loss after the first profit target has been hit. attached is the MQ4 file

looking forward to a speedy response and appreciate all the help
Attached File(s)
File Type: mq4 ManageTPv2-4.mq4   6 KB | 486 downloads
 
 
  • Post #15
  • Quote
  • Mar 5, 2016 5:07am Mar 5, 2016 5:07am
  •  mkhezri1355
  • | Joined Aug 2015 | Status: Member | 8 Posts
Quoting rockit
Disliked
Yes, now clear. {file}
Ignored
Hi, it's possible to convert this indicator in mq5?
Attached File(s)
File Type: mq4 StrengthMeter_wSuffix-mod2.mq4   15 KB | 519 downloads
 
 
  • Post #16
  • Quote
  • May 27, 2016 6:53am May 27, 2016 6:53am
  •  MadaForex
  • | Joined Jun 2014 | Status: Junior Member | 4 Posts
Hello there,
with the same Kenoby's raison and story, i humbly request someone to manually convert this usefull pivot point label indicator from ".mq4" to ".mq5".
I already tried with automated converter but it failed.

It can be usefull for others ... and very surely for me... at least : )

Regards
Attached File(s)
File Type: mq4 Pivot_Points_SP.mq4   4 KB | 455 downloads
 
 
  • Post #17
  • Quote
  • May 27, 2016 10:24pm May 27, 2016 10:24pm
  •  fredix
  • | Joined Apr 2016 | Status: Member | 31 Posts
Here is for you, Mada.

Attached File(s)
File Type: mq5 Pivot_Points_SP.mq5   5 KB | 610 downloads
 
 
  • Post #18
  • Quote
  • Jun 10, 2016 5:27am Jun 10, 2016 5:27am
  •  MadaForex
  • | Joined Jun 2014 | Status: Junior Member | 4 Posts
Hello Fredix,
I already have answered to your kind post here :
http://www.forexfactory.com/showthre...79#post8958479

But my response is still in moderation (!?).

Anyway, i tried the conversion you have done for me. Thank you very much....sincerly.

Unfortunatly, it doesen't work properly.
 
 
  • Post #19
  • Quote
  • Jul 28, 2016 7:51pm Jul 28, 2016 7:51pm
  •  Spock23
  • | Joined Jun 2015 | Status: Member | 8 Posts
Quoting fredix
Disliked
Here is for you, Mada. {file}
Ignored
Fredix, could you convert this code to mql5, please?
Attached File(s)
File Type: mq4 ZTRY V2.1.mq4   73 KB | 505 downloads
 
 
  • Post #20
  • Quote
  • Jul 29, 2016 2:39am Jul 29, 2016 2:39am
  •  fredix
  • | Joined Apr 2016 | Status: Member | 31 Posts
Sorry, this is too big.
 
 
  • Platform Tech
  • /
  • Need help to convert simple MQL4 indicator to MQL5
  • Reply to Thread
    • Page 1 2 3
    • Page 1 2 3
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023