Is it possible to export in a .xls, .txt or .whatever file my indicator's values?

 

Hi,

DDE or whatever. Is There a protocol for obteining the same as for historical quotes (History Centre): that is to say, downloading indicator output bar-by-bar?

Thank you so much,

SA

 

MT4 has functions for writing CSV or Binary files.


You could add file writing to indicator code...

Or...

Write a script/indicator using iCustom() calls to get indicator values and write to a file


https://docs.mql4.com/files

 
And here is sample - RSI to File
 
Rosh:
And here is sample - RSI to File


Thak you all! That's very relevant for me!

SA

 
Rosh:
And here is sample - RSI to File


OK. I made my script and in C:\Programs\FXDD - MetaTrader 4\experts\files I expected to find several csv...

Assuming that every script like this below - or more complex - is rightly to output one or more files into the directory above...

----------------------------------------

int start()
{

int handle;
datetime orderOpen=OrderOpenTime();
handle=FileOpen("filename.csv", FILE_WRITE|FILE_CSV);
if(handle>0)
{
FileWrite(handle, Close[1], Open[0], High[0], Low[0], TimeToStr(orderOpen));
FileClose(handle);
}

return(0);
}

----------------------------------------

... why nothing happens, neither there nor in different folders?


Thanks,

SA

 

Do you get an error?

Your file writing code works fine here.

 
phy:

Do you get an error?

Your file writing code works fine here.



The fact is:

  1. I have my C:\Programs\FXDD - MetaTrader 4\experts\files folder empty;
  2. I launch the script;
  3. No compiling errors;
  4. My C:\Programs\FXDD - MetaTrader 4\experts\files folder is still empty;
  5. In the "Experts" terminal page I found " 'test' ( - my script - ) is compiling" even after a lot of time;
  6. So I tried to restart the platform but... terminal.exe did not even open and did slow down pc as if there were heavy pendent processes.

I must plan to reinstall the platform,


Replies are always very appreciated.

SA

 
SimonTrader:
phy:

Do you get an error?

Your file writing code works fine here.



The fact is:

  1. I have my C:\Programs\FXDD - MetaTrader 4\experts\files folder empty;
  2. I launch the script;
  3. No compiling errors;
  4. My C:\Programs\FXDD - MetaTrader 4\experts\files folder is still empty;
  5. In the "Experts" terminal page I found " 'test' ( - my script - ) is compiling" even after a lot of time;
  6. So I tried to restart the platform but... terminal.exe did not even open and did slow down pc as if there were heavy pendent processes.

I must plan to reinstall the platform,


Replies are always very appreciated.

SA


OK. I found it. I realized the only way to make the script work is to drag and drop to Graph...

Thanks a lot.

SA

 
SimonTrader wrote >>

Hi,

DDE or whatever. Is There a protocol for obteining the same as for historical quotes (History Centre): that is to say, downloading indicator output bar-by-bar?

Thank you so much,

SA

MT4 build 200 has been ready with historical data dowloader. You may find on Menu-Tool-Historical data. Just export to CSV file.

Reason: