MT4 PHP API - page 2

 
I know php. You dont need 3 softwares or a ea to do this. Simply send data from mt4 via ftp to your webserver, use a php script to read the data and input it in a mysql database and finally a php script in the display page to read and display the data and another script to read the data and output it in xml(api system) for access via android, iphone etc apps.
 
I've just had an idea for an MT4 API using TCP/IP. I got the idea from an MT5 article and thought that it may apply here. So I did a bit of experimenting and came out with the attached files. Just as a test I made it produce an xml file and send it back. That works fine except it seems to be limited by the buffer size. To be honest I really wanted this so that I could show live rates on a website or at least near live. That can wait till tomorrow.
Files:
mql4sapi.zip  3 kb
 
heelflip43:
To be honest I really wanted this so that I could show live rates on a website or at least near live. That can wait till tomorrow.
You will probably be in breach of your license agreement if you do that.
 
gpassali:

I can solve your problem.

To solve the problem, it needs to write 3 software:
- an EA in MQL4 to write in file the open positions in dedicated folder;
- a software that reads this file and send the open position to web site;
- a software in PHP that receive this data and save it on db MySql

I can also write the php page that read this data in db MySql and publish it.

It's a work.

That's not true. Two "software" is enough, because the MetaTrader can directly save / stream the quotes into a MySQL database.
 
I'm not sure about that, your probably right it's not really that important. I was mainly saying that there's a possibility of creating a simple API through TCP/IP. I also was wondering how places like Forex Factory's market could deliver live quotes.
 
heelflip43:
. I also was wondering how places like Forex Factory's market could deliver live quotes.
MetaTrader is not the only platform and not all brokers use it.


MT4's target audience are only the Joe Sixpack type of retail traders who have little money and only modest pretensions (and the brokers who aim at these types of customers).

You won't find MT4 in any professional environments. It is not meant to be used there, otherwise it would have a proper API so one could actually use it for anything.

 
gpassali:

I can solve your problem.

To solve the problem, it needs to write 3 software:
- an EA in MQL4 to write in file the open positions in dedicated folder;
- a software that reads this file and send the open position to web site;
- a software in PHP that receive this data and save it on db MySql

I can also write the php page that read this data in db MySql and publish it.

It's a work.


I'm a web developer and facing the same problem as this is my first experience.

can you do it for me? And tell me how to integrate it to the website for users to receive live feed of their trading result.

Kindly PM with details.

 
7bit:
MetaTrader is not the only platform and not all brokers use it.


MT4's target audience are only the Joe Sixpack type of retail traders who have little money and only modest pretensions (and the brokers who aim at these types of customers).

You won't find MT4 in any professional environments. It is not meant to be used there, otherwise it would have a proper API so one could actually use it for anything.

:))) You are not an MT fan as I see

 
tonny:
I know php. You dont need 3 softwares or a ea to do this. Simply send data from mt4 via ftp to your webserver, use a php script to read the data and input it in a mysql database and finally a php script in the display page to read and display the data and another script to read the data and output it in xml(api system) for access via android, iphone etc apps.

Hi Tonny,

 Where can i find these scripts for Mysql, read the data, output in xml.

I would like to display all my open/pending orders sent from MT4 via ftp publisher  in real time on my own website. 

 

Thanks and Rgds. 

 
gpassali:

I can solve your problem.

To solve the problem, it needs to write 3 software:
- an EA in MQL4 to write in file the open positions in dedicated folder;
- a software that reads this file and send the open position to web site;
- a software in PHP that receive this data and save it on db MySql

I can also write the php page that read this data in db MySql and publish it.

It's a work.


Hello gpassali, i need your help, please contact me at skype : "sushilraghav"
Reason: