int result = WebRequest(...);
Return Value
HTTP server response code or -1 for an error.
Return Value
HTTP server response code or -1 for an error.
Thank you for your continuing support, Marco!
Could you kindly teach me how to use this code for a market EA?
Sorry that I'm not a coder.
Example:
void OnStart() { string cookie=NULL,headers; char post[],result[]; string url="https://finance.yahoo.com"; //--- To enable access to the server, you should add URL "https://finance.yahoo.com" //--- to the list of allowed URLs (Main Menu->Tools->Options, tab "Expert Advisors"): //--- Resetting the last error code ResetLastError(); //--- Downloading a html page from Yahoo Finance int res=WebRequest("GET",url,cookie,NULL,500,post,0,result,headers); if(res==-1) { Print("Error in WebRequest. Error code =",GetLastError()); //--- Perhaps the URL is not listed, display a message about the necessity to add the address MessageBox("Add the address '"+url+"' to the list of allowed URLs on tab 'Expert Advisors'","Error",MB_ICONINFORMATION); } else { if(res==200) { //--- Successful download PrintFormat("The file has been successfully downloaded, File size %d byte.",ArraySize(result)); //PrintFormat("Server headers: %s",headers); //--- Saving the data to a file int filehandle=FileOpen("url.htm",FILE_WRITE|FILE_BIN); if(filehandle!=INVALID_HANDLE) { //--- Saving the contents of the result[] array to a file FileWriteArray(filehandle,result,0,ArraySize(result)); //--- Closing the file FileClose(filehandle); } else Print("Error in FileOpen. Error code =",GetLastError()); } else PrintFormat("Downloading '%s' failed, error code %d",url,res); } }
Example:
Thank you so much, Marco.
Is this a code for a script?
Could you kindly teach me how can I use it in terminal?
Sorry for my terrible knowledge about code...

- www.mql5.com
Thank you so much, Marco!
dear skye,
if there's a error retrieving infos with webrequest, the author of the ea has probably put an error code somewhere - check the status tab or the upper left corner of the chart the ea has been attached to.
if not, you could also private message him to make an update - it's quickly done, and more than relevant.
dear skye,
if there's a error retrieving infos with webrequest, the author of the ea has probably put an error code somewhere - check the status tab or the upper left corner of the chart the ea has been attached to.
if not, you could also private message him to make an update - it's quickly done, and more than relevant.
Dear Icham, thank you very much!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear experienced traders
Do you how to check the web request is working or not?
I'm test one news EA in same remote desktop VPS and same set but different broker. If it works well, the EA could stop open new positions during big news.
I find an issue that is, during the big news, some terminal stop open new positions and some terminal keep open new positions.
I think it might because of web request is not working by some mistake.
Do you how to check the web request is working or not?
Do you have any experience about this kind of issue?
* I can't find any history in journal for web request.
Thank you in advance and best wishes,
Sky