HTTP using WinINet directly in mql4 script for MetaTrader 4

This is a “conceptual” script I developed to test the WinINet functions to load a HTTP page directly from mql4

The code imports the wininet.dll original windows library, then it calls all the needed functions, as stated in MSDN documentation, simply translating the mql data types:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa383630(v=vs.85).aspx

You have only to run the script on a chart, and you’ll see a MessageBox with the https://www.mql4.com html page

I used this code in one of my EA, to upload a set of signals from my ASP.NET site, calling a page that send the data file

This is the simple C# asp.net page code to send the file:

f (File.Exists(@ “C:\ … my data directory …. \signs.csv” ))

{

Response.TransmitFile(@”C:\ … my data directory …. \signs.csv”);

Response.Flush();

Response.End();

}

Free Download

HTTP using WinINet directly in mql4 script for MetaTrader 4

MT4 Forex Script Characteristics

Platform: Metatrader 4

Type: Script

Time frames: any.

How to install Screenshot Script in MetaTrader 4 / MT4:

Copy and paste the TestHTTP.mql4 files into the MQL4 Scripts folder of the Metatrader 4 trading platform.

Restart your MetaTrader 4 application (assuming it’s currently open) … or Launch your MetaTrader 4 application

You can access this folder from the top menu as follows:

File > Open Data Folder > MQL4 > Script (paste here)

On the left hand side, look for the “Navigator” window and under the “Common” tab, look into the “Scripts” section

Locate the indicator which you have just downloaded into the folder stated in Step 1

Drag (Click and drag) the Script onto the chart (when you want the task to be performed)

your task should now be executed…

Leave a Comment