Download MetaTrader 5
To add comments, please log in or register
Follow the news. View our company's official channel!
Masood Heidarnia
14
Masood Heidarnia 2015.06.07 13:00 

hello,

I think in principle it's very useful to open up possible resources and find this article is very intersting. 

But I'm not very experienced programmer and therefore I have some question.


I have winform application with C# & .Net4  and I have an account (Demo or Real) in my broker(Alpari) and with metatrader 5.


Now my problem: 

1- How can i get and show my balance in C# application?

2- How can i show my account history in listbox?



best regards

data46
27
data46 2015.06.14 01:09  
FirstLine:

hello,

I think in principle it's very useful to open up possible resources and find this article is very intersting. 

But I'm not very experienced programmer and therefore I have some question.


I have winform application with C# & .Net4  and I have an account (Demo or Real) in my broker(Alpari) and with metatrader 5.


Now my problem: 

1- How can i get and show my balance in C# application?

2- How can i show my account history in listbox?



best regards

You need to create an EA that writes to a file and then your C# app reads the file. Make sure you use a try/catch in C# in case the file is busy, so it fails gracefully until the next timer request.

There are much more complicated alternatives like pipes, but do some research on fileWrite() in mql5 and it's quite easy to implement. 

jseppa
10
jseppa 2016.01.26 08:55  
Masood Heidarnia:

hello,

I think in principle it's very useful to open up possible resources and find this article is very intersting. 

But I'm not very experienced programmer and therefore I have some question.


I have winform application with C# & .Net4  and I have an account (Demo or Real) in my broker(Alpari) and with metatrader 5.


Now my problem: 

1- How can i get and show my balance in C# application?

2- How can i show my account history in listbox?



best regards

 

I've gone a different approach. Instead of using IPC, I'm creating a Thread with the MT4 expert, which then communicates back via simply setting some shared attributes.

It's still a work in progress, and not tested yet. But initial functionality seems to do the trick:

Instructions and source are here: 

https://github.com/jseparovic/MQL4CSharp 

/
To add comments, please log in or register