Download MetaTrader 5

FilesExist - check if a file exists in web folder

To add comments, please log in or register
Improve your rating. Execute orders in Freelance service!
Rubens Marinho
242
Rubens Marinho 2015.07.01 17:05 

Here:

http://docs.mql4.com/files/fileisexist

There are the instruction to handle files (down/up, read-writhe ...)

I'm trying to code this to check if a file exists in web folder...

Any idea how to do that?


Regards,

FileIsExist - MQL4 Documentation
  • docs.mql4.com
FileIsExist - MQL4 Documentation
Alain Verleyen
Moderator
30719
Alain Verleyen 2015.07.01 18:41  
Rubens Marinho:

Here:

http://docs.mql4.com/files/fileisexist

There are the instruction to handle files (down/up, read-writhe ...)

I'm trying to code this to check if a file exists in web folder...

Any idea how to do that?


Regards,

What is "web folder" ?

Anyway, mql4 file functions only work in the sandbox : all what is under MQL4\Files

Rubens Marinho
242
Rubens Marinho 2015.07.01 21:17  

I mean with a web folder:

http://www.domain.com/folder/file.bak


The idea is verify if a file exists in web folder, and, if yes the EA will grant the trades, for example:

//+------------------------------------------------------------------+
//|                                                                Sample.mq4 |
//|           Copyright 2005-2015, MetaQuotes Software Corp. |
//|                                                   http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright   "2005-2015, MetaQuotes Software Corp."
#property link        "http://www.mql4.com"

extern string file_user = "file.bak";


int start() {


if (  file_user()!= http://www.domain.com/folder/)
   {
    Alert("WRONG FILE!");
   return;
   }


And my doubt is, how can I check that?

MQL4: automated forex trading, strategy tester and custom indicators with MetaTrader
  • www.mql4.com
MQL4: automated forex trading, strategy tester and custom indicators with MetaTrader
Alain Verleyen
Moderator
30719
Alain Verleyen 2015.07.01 21:35  
You have to use WebRequest().
Rubens Marinho
242
Rubens Marinho 2015.07.01 21:46  

Yes, I saw and tried here:

http://docs.mql4.com/common/webrequest

But, I wasn't able to code it... could you please help me?

WebRequest - MQL4 Documentation
  • docs.mql4.com
WebRequest - MQL4 Documentation
Alain Verleyen
Moderator
30719
Alain Verleyen 2015.07.01 21:54  
To add comments, please log in or register