MT4/5 and C plus plus or Java interface
Results 1 to 6 of 6

Thread: MT4/5 and C plus plus or Java interface

  1. #1
    Dear All,

    I would like to start a thread with this subject. I believe this will help some traders who struggle with their EA's scripts and Indiors.
    I'm not a fantastic coder ( not my main schooling ) however I have some expertises and ideas that I would love to implement utilizing best programming methods ( reuse ).
    Among my end goal is to handle and display graphisms based on the factors we can extract from MT4/5. Another road is to devellop external GUI
    In order to make it happen and share the job in the future, I want to gather from our very best experts any kind of advise's and substances that could explain how:

    - interfacing MT4/5 using Java or C apps
    - passing variables to external progr
    - collecting data back from external progr

    nota: I mentioned C and Java. I have nothing against Pyton or even C#. The main platform will be PC running Windows.

    I hope this thread will be quite active. Eager to hear from you guys !

    Thanks,

    Phil

  2. #2
    Quote Originally Posted by ;
    Been there, done that. Am using my own GUI for live trading and am totaly independent of MT - MT just functions me as a method to'speak' to the broker and get market information. The c code I think is as'near the metal' as you can, so that I can share some very low level tech if a person is interested.
    Due Rockit!
    Are you a coding expert ? Did you create the best utilization of C ( Objects oriented programming,. .) ?
    I know you prefer your own GUI:--RRB- Can you please share a screenshot of your GUI so that we can enjoy your job?
    BTW... do you have any tutorials or similar substances you'd recommend to all of us ( such as begginers )?

  3. #3
    My coding skills are sufficient to do what I need for myself.
    And that I understand things as I need them.

    Below I've attached a current screenshot of my trading shell (showing mtf eurusd).
    This is what I use for trading.
    I really do use OOP but that I also use more direct programming from the code, even assembler lang for specific parts that draw stuff. It's not the prettiest code since it's intended to be efficient using the least amount of bloat.
    I don't use any 3rd party libraries.

    As for the how-to stuff. It is dependent upon what sort of abstraction amount you want to code at.
    For low level stuff you'll have to learn the windows api. There is extensive material on the topic on microsoft's servers, but also at different places.
    In the other case you can use ready made open source libraries using bindings for various languages, so you do no need bother about how the stuff is brought to screen.
    Additionally there is I think a ready made bridge between MT and external appliions:
    https://www.mql5.com/en/articles/1361

  4. #4
    Here is how I did it. It's probably not the ideal way to do it but it achieved everything I wanted it to do:

    I am not a fan of all those weird dll calls.
    I was never truly successful using pipes in java (even thought that may be the clean way to do it).
    How I did it was to compose a Listener EA which ran in my MT Terminal that the entire time monitoring a directory. With java it is really easily to create text files and as soon as you created a protocol you can do everything you want to do.

    Java program writes information in a textfile Ea reads the file interprets the content and deletes the file again. With that it is quite simple to send info back and forth and also the speed was sufficient enough for me personally.

    I just use this option though if I need advanced data structures, more computation electricity or access to a database or internet available details. (with the changes to mql4 it somehow became object oriented and also you can do a bit things around ). Creating a personal GUI would be nice to draw charts but that sounds just like a little bit of an overkill and a lot of work.

  5. #5
    Thanks Kilian19!
    Another interesting option really. Btw, passing through a record costs some significant latency I guess?
    Rather to store the data in a document why to not store it in a reserved memory block to get quicker access?
    Do you've got screenshot of your app?
    I didn't mention clearly in my first article I'm also elaborating a type of HFT engine out MT4. So latency is vital.

    Thank you for your participation.

    Phil

  6. #6
    Been there, done that.
    Am using my own GUI for live trading and am totaly independent of MT -
    MT just serves me as a means to'talk' to the broker and receive market data.
    The c code I think is as'close to the metal' as possible, so I can share some very low level tech if a person is interested.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.