Topic: C# read open Orders

Hi,
I want to read my open and pending Orders out from C#.
Maybe directly from the Brokers-Server or out of my MT5 Terminal.

There are 2 interesting Articles for this:
Net-Framework for MT5 since 2018:
https://www.mql5.com/de/articles/5563

Integration Phyton:
https://www.mql5.com/de/docs/integratio … etatrader5

Can someone here help me out, to do this steps?
My need is only to read out the current open and pending Orders of my MT5 Account.

Every thing helpfull will be fine.

Re: C# read open Orders

Dragon wrote:

Hi,
I want to read my open and pending Orders out from C#.
Maybe directly from the Brokers-Server or out of my MT5 Terminal.

There are 2 interesting Articles for this:
Net-Framework for MT5 since 2018:
https://www.mql5.com/de/articles/5563

Integration Phyton:
https://www.mql5.com/de/docs/integratio … etatrader5

Can someone here help me out, to do this steps?
My need is only to read out the current open and pending Orders of my MT5 Account.

Every thing helpfull will be fine.

Re: C# read open Orders

Hello,

I think the articles are way over-kill for what you want to do.  Whenever I want to communicate between terminals or with the outside world (i.e. C#) I'll create a file under ..\Common\Files.  MT4/MT5 can read/write to that location, as can any .NET app written in C#.

Re: C# read open Orders

You are absolue right with over-killing ... Maybe i will follow your way.

My C# Program will do his job around at any specifig time dynamically. So MT5 has to place the open Order info exactly at this time.

Is there a way to tell MT5 to create the File with the needed Information?
I mean a push out from C# to MT5 (maybe an simple EA) to write that File?
Or will that be a read / write File every second in MT5?

I am thinking on CPU ... C# writes a specifig File ...
MT5 look every second if this File exists and starts writing all needed Information to a defined File.

This will be a short work around if no other way will be found.

Thank you until now for your input to me.

Re: C# read open Orders

Dragon wrote:

You are absolue right with over-killing ... Maybe i will follow your way.

My C# Program will do his job around at any specifig time dynamically. So MT5 has to place the open Order info exactly at this time.

Is there a way to tell MT5 to create the File with the needed Information?
I mean a push out from C# to MT5 (maybe an simple EA) to write that File?
Or will that be a read / write File every second in MT5?

I am thinking on CPU ... C# writes a specifig File ...
MT5 look every second if this File exists and starts writing all needed Information to a defined File.

This will be a short work around if no other way will be found.

Thank you until now for your input to me.


Hello,

I thought you knew how to program -- if so, then it is an easy task.  Neither MT5 (nor MT4) communicate directly with C# -- they are completely unrelated programming environments.  However, both have built-in APIs that make reading / writing files a simple task and, probably, one of the most common.  As for how often to read / write -- well, as the programmer, that is up to you.

If you are not a programmer but wish to become more familiar -- this could serve as a beginner's project.  Maybe it takes you a week or two -- so what.   In the end you gain some experience and this may lead to some more ideas for sharing information between terminals and C#.

Good luck!