(MQ4) Import data from MS EXCEL to Meta Trader 4 Expert Advisor in real time

 

Hi,


I have calculated in my MS Excel sheet many values for different forex symbols such as: Stop Loss, Take Profit, Lots() etc...

How can I import data from MS Excel into my Expert Advisor in order to set for example Stop Loss as value from my excel sheet("source"), cell(A3) ?


Regards,

 
Hi
//this is for example. it reads the first two columns in ms excel and the last line. total columns in this file is 3
//---------------------------------------------------------------------------
                      
             while( FileIsEnding( handle ) == false )
             {
               i++;
               text[i] = FilereadString( handle );
                 if ( FileIsEnding( handle ) == true )
                 {
                  xt = StrToDouble( text[i-3] );
                  bx = StrToDouble( text[i-2] );
                  break;
                 }
             }

         Alert( "xt = ", xt,"   bx = ", bx );
         
 
Boeing747:

Can I reffer under MQL4 to the NAME of the XLS file saved on C:\ and to the NAME of the EXCEL SHEET ?

 
puncher:

Can I reffer under MQL4 to the NAME of the XLS file saved on C:\ and to the NAME of the EXCEL SHEET ?

Do you know the format of an XLS file ? isn't it proprietary and a closed standard ?
 
puncher:

Can I reffer under MQL4 to the NAME of the XLS file saved on C:\ and to the NAME of the EXCEL SHEET ?

EA works only with /csv and /txt files
 
RaptorUK:
Do you know the format of an XLS file ? isn't it proprietary and a closed standard ?


RaptorUK I see that you have the problem with other aplications than Meta Trader 4. There are libraries for Meta Trader 4 that allow export data to MS Excel like this: https://www.mql5.com/en/code/10881

I am looking for the libraries that allow to obtain import data do MS Excel and obtain target like this: https://www.youtube.com/watch?v=220ZRmAQk9g

 
puncher:


RaptorUK I see that you have the problem with other aplications than Meta Trader 4. There are libraries for Meta Trader 4 that allow export data to MS Excel like this: https://www.mql5.com/en/code/10881

Nope, that code does not export to Excel file format, it is a simple Direct Data Exchange. So you are looking for DDE type scenario from Excel to MT4 . . . this might help: http://www.forexfactory.com/showthread.php?p=4135336#post4135336
 
RaptorUK:
Nope, that code does not export to Excel file format, it is a simple Direct Data Exchange. So you are looking for DDE type scenario from Excel to MT4 . . . this might help: http://www.forexfactory.com/showthread.php?p=4135336#post4135336

Hi RaptorUK,


I need excellink.dll library. I found another subject: https://www.mql5.com/en/forum/107448/page2#217124

& it seems that I looked for... but I can not download excellink.dll library and any manual for it how to use the DLL library.

 
RaptorUK:
Nope, that code does not export to Excel file format, it is a simple Direct Data Exchange. So you are looking for DDE type scenario from Excel to MT4 . . . this might help: http://www.forexfactory.com/showthread.php?p=4135336#post4135336


It is called Dynamic Data Exchange :)

 
sangmane:

It is called Dynamic Data Exchange :)

Yes, thanks, thats a big help. I'm sure puncher will be relieved . . .
 

Hey Raptor, you're most welcome! I'm glad to know that you found my post helpful ...

Puncher, excellink.dll can be downloaded from <advertising removed>