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

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

MQL4 code help 12 replies

Harvester 14 replies

MQL4 Language Most Recent Version is it updated beyond the tutorial on the mql4 websi 6 replies

MT4 Indicators Usage Tutorial/MQL4 Reference Documents 36 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: C++ MQL4 Forex Harvester
Exit Attachments
Tags: C++ MQL4 Forex Harvester
Cancel

C++ MQL4 Forex Harvester

  • Last Post
  •  
  • Page 1 23 4
  • Page 1 23 4
  •  
  • Post #1
  • Quote
  • First Post: Edited Oct 6, 2016 2:40pm Jun 23, 2016 8:32am | Edited Oct 6, 2016 2:40pm
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
Hi guys. I am building a forex bot in C++ with MQL4 (and possibly FIX API in future).
I am looking for experienced C++ coders are interested to contribute.
Also looking for a Build Engineer who can build automate compilation steps for various platforms/compilers/projects.

I maintain a private repository on Bitbucket, so we could have a team working on it.

You can follow my progress in this topic.
http://www.bunkerforexforum.com/view...php?f=15&t=133

Currently I work alone on it and I estimate at least 1 year of development till I have a testable bot running. I build it from scratch and started just a few weeks ago.
  • Post #2
  • Quote
  • Jun 23, 2016 9:16am Jun 23, 2016 9:16am
  •  fonx
  • | Joined Jul 2014 | Status: Member | 53 Posts
Great. I've been thinking for a while to switch from mql to C++ I have put aside my coding lately but I'll try to find to follow your track, even to contribute if I get good enough!

Good luck!
 
 
  • Post #3
  • Quote
  • Jun 23, 2016 2:58pm Jun 23, 2016 2:58pm
  •  hanzov
  • | Joined Nov 2012 | Status: Member | 128 Posts
Pascalx,
I read http://www.bunkerforexforum.com/view...php?f=15&t=133
But I still not recognize why you started development under C++/
C++ is a great challenge and your strategy should really require C++ opportunities to be used..
 
 
  • Post #4
  • Quote
  • Jun 23, 2016 3:17pm Jun 23, 2016 3:17pm
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Interesting thing to me: can you call mql functions from a dll, or even better from outside?
When using dll, since it runs in the same process context, it can access mql variables (or better say arrays) directly if they are passed to the dll.
..
 
 
  • Post #5
  • Quote
  • Jun 23, 2016 5:11pm Jun 23, 2016 5:11pm
  •  hanzov
  • | Joined Nov 2012 | Status: Member | 128 Posts
That's answer
https://www.mql5.com/en/forum/35565

What means "even better from outside"? From web?
 
 
  • Post #6
  • Quote
  • Jun 23, 2016 5:43pm Jun 23, 2016 5:43pm
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
Quoting hanzov
Disliked
Pascalx, I read http://www.bunkerforexforum.com/view...php?f=15&t=133 But I still not recognize why you started development under C++/ C++ is a great challenge and your strategy should really require C++ opportunities to be used..
Ignored
The main reasons I don't like to do it in native MQL is that its language features are too limited and the MQL debugger is bad.

Quoting rockit
Disliked
Interesting thing to me: can you call mql functions from a dll, or even better from outside? When using dll, since it runs in the same process context, it can access mql variables (or better say arrays) directly if they are passed to the dll.
Ignored
I am currently writing C++ to MQL bridge that can call functions and access data in MQL. It also supports a shared and RPC mode, where RPC mode is slower but means the bot code in C++ is debuggable, even in Strategy Tester. It will take a bit more time to finish that part. The bridge can later also be plugged to other Trade API's.
 
 
  • Post #7
  • Quote
  • Jun 23, 2016 6:05pm Jun 23, 2016 6:05pm
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Quoting hanzov
Disliked
That's answer https://www.mql5.com/en/forum/35565 What means "even better from outside"? From web?
Ignored
I'm operating my own trading gui (a separate application from mt4).
To execute trades I currently use a mql script on the mt4 side that uses windows api event objects (i.e. WaitForSingleObject/WaitForMultipleObjects function).
Other possibility could be to post message (PostMessage function) to a mt4 window and having an ea catch it and execute. However, the fastest way executing trades would be a direct call of OrderSend function..
..
 
 
  • Post #8
  • Quote
  • Jun 23, 2016 6:13pm Jun 23, 2016 6:13pm
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Quoting pascalx
Disliked
It also supports a shared and RPC mode
Ignored
I wonder what is faster, rpc or event objects? Guess is, rpc because event objects get handled at every os' tick I guess. What does 'shared' mean?
..
 
 
  • Post #9
  • Quote
  • Jun 23, 2016 6:16pm Jun 23, 2016 6:16pm
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
Quoting rockit
Disliked
{quote} I wonder what is faster, rpc or event objects? Guess is, rpc because event objects get handled at every os' tick I guess. What does 'shared' mean?
Ignored
The shared mode means the DLL will be loaded by the terminal process completely, whereas RPC means the bot is split in 2 parts, where the bot runs standalone and Terminal loads the Bridge DLL to talk with the Bot process. Thus it does not need the RPC part and is faster (especially in Strategy Tester). I use RPC mode for debugging only.
 
 
  • Post #10
  • Quote
  • Jun 24, 2016 6:08am Jun 24, 2016 6:08am
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Quoting pascalx
Disliked
The shared mode means the DLL will be loaded by the terminal process completely, whereas RPC means the bot is split in 2 parts
Ignored
Ah - ok. I had that too (shared) with my extra gui, but there was a problem that I could not solve (concerning an extra window opened from dll) so I had to split it.
..
 
 
  • Post #11
  • Quote
  • Jun 24, 2016 2:45pm Jun 24, 2016 2:45pm
  •  hanzov
  • | Joined Nov 2012 | Status: Member | 128 Posts
Quoting rockit
Disliked
{quote} I'm operating my own trading gui (a separate application from mt4). To execute trades I currently use a mql script on the mt4 side that uses windows api event objects (i.e. WaitForSingleObject/WaitForMultipleObjects function). Other possibility could be to post message (PostMessage function) to a mt4 window and having an ea catch it and execute. However, the fastest way executing trades would be a direct call of OrderSend function..
Ignored
Possible to call OrderSend through wrapper.
You have add imports for functions from dll inside mql script
I did the same in my frozen project, https://sourceforge.net/projects/web2ex4/
It is like you want, but it is prototype fot web access to MT$.
 
 
  • Post #12
  • Quote
  • Jun 28, 2016 10:17am Jun 28, 2016 10:17am
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Quoting hanzov
Disliked
Possible to call OrderSend through wrapper.
Ignored
Thank you for your help.
However, the code offers solution for a different problem.
I think I already have the best possible solution for my problem, but I was curious, if perhaps there could exist a more direct approach, but I think not, unfortunately so.
..
 
 
  • Post #13
  • Quote
  • Jun 28, 2016 10:21am Jun 28, 2016 10:21am
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
The best solution would be if MQL provided a native API for C++. But since there is not we have to build workarounds. It's a bit sad that MQL has really weak compatibility but is used by most brokers.
 
 
  • Post #14
  • Quote
  • Jul 5, 2016 10:18am Jul 5, 2016 10:18am
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
Bump. Looking for coders who want to contribute to the project.
 
 
  • Post #15
  • Quote
  • Jul 5, 2016 4:52pm Jul 5, 2016 4:52pm
  •  hanzov
  • | Joined Nov 2012 | Status: Member | 128 Posts
Are you speaking on "Market Bridge between MQL4 and C++."?
http://www.bunkerforexforum.com/view...php?f=15&t=133
 
 
  • Post #16
  • Quote
  • Jul 6, 2016 4:33am Jul 6, 2016 4:33am
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
Yes of course. The final product will be a complete trading bot in C++ that is connected with MQL4 (and possibly other platforms later).

It would be great to combine efforts to achieve results faster. However, it requires experienced C++ programmers, because it's a complex project.
 
 
  • Post #17
  • Quote
  • Jul 26, 2016 5:24pm Jul 26, 2016 5:24pm
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
The C++ bridge is by now 50% complete. I am still looking for assistance though.

If you want to make gazillions of cash join my project
 
 
  • Post #18
  • Quote
  • Jul 27, 2016 1:14am Jul 27, 2016 1:14am
  •  JensItzig
  • Joined Sep 2013 | Status: Member | 362 Posts
I can't see an advantage in bulding an own c++ bridge for MQ4 (and there are still enough tools out there right now). What was your motivation?

Only debugging in tester? Try one of the other bridges and you can debug.
Want the illusion of multithreading? No chance with only on instance of MT4.
Want to build a web application above the MT4 data? Write a script to export the data into a database and let an EA run to add the incoming ticks.
You feel comfortable in C++ and don't like MQL? They are very similar, nearly identical. Of course there are points that you must know about the behaviour of MQ4 but this problem you are facing with every programming language.

If you have FIXED API. Be happy and ignore MT4.
 
 
  • Post #19
  • Quote
  • Jul 27, 2016 5:17am Jul 27, 2016 5:17am
  •  pascalx
  • | Joined Apr 2016 | Status: Member | 32 Posts
Quoting JensItzig
Disliked
I can't see an advantage in bulding an own c++ bridge for MQ4 (and there are still enough tools out there right now). What was your motivation? Only debugging in tester? Try one of the other bridges and you can debug. Want the illusion of multithreading? No chance with only on instance of MT4. Want to build a web application above the MT4 data? Write a script to export the data into a database and let an EA run to add the incoming ticks. You feel comfortable in C++ and don't like MQL? They are very similar, nearly identical. Of course there are...
Ignored
Hi bro, thanks for your opinions on this topic.

I was searching for C++ MQL4 adaptations but did not find any. I found two for C#, but that is not the same thing (nquotes). Plus I think my C++ bridge is better than nquotes (no offense). Which bridges do you know of?

I don't think multi-threading is needed for trading logic. But yea if someone wanted that it would certainly be possible. I was using MQL4 for a month and wrote a few thousand lines of code, but it just held me back, because compared to C++ it lacks essential language features. The lack of STL was less of a problem. And yea the debugger is really sad. I am not a fan of much logging, thus debugger is really important for me to check the state. Using MQL for a while was motivation enough for me to abandon it and try to get MT4 working through C++. It would be awesome if someone would share the same mindset and helped me out.

I try to get hold of FIX API, but haven't yet. Is the code for FIX API somewhere ready for grabs or can it only be accessed through a Broker?

Thanks.
 
 
  • Post #20
  • Quote
  • Jul 27, 2016 6:08am Jul 27, 2016 6:08am
  •  JensItzig
  • Joined Sep 2013 | Status: Member | 362 Posts
FIXED API access must be granted from your broker.

I understand why you are doing it, but i don't see that the reward will high enough for the effort you put in. Since you need to use an EA to communicate you are doomed and bound to MT4.

Multithreading can only be achieved via multiple terminals (that's the only reason is see) but since you don't build a really big dashboard or multi pair EA you can achieve this also with MQ4.

Since now i have found only a few things that can be not done by MQ4 (and mostly you can find a workaround). To show you that i not only talking trash i share a screenshot with indicators and eas that are build only with MQ4 (and i bet those stuff will not be available in those forums ).

Attached Image (click to enlarge)
Click to Enlarge

Name: Screenshot1.png
Size: 155 KB


Trust me you get more out of it when you investing time into Mq4 instead building just another bridge.
 
 
  • Platform Tech
  • /
  • C++ MQL4 Forex Harvester
  • Reply to Thread
    • Page 1 23 4
    • Page 1 23 4
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