Download MetaTrader 5

Call import function with an EA

To add comments, please log in or register
Tidiane Traore
13
Tidiane Traore  

I have set an EA for sending positions with currencies , and that allows to import functions from the librairies . It checks the Hour and the Price Bid before sending Buy Orders with the selected currencies with the settings .


Here is the EA : 





#import "Conversion_Datas_To_Mql4.mqh"
char FileToWrite(char &news12[200][7], string fileContents_F12) ; 
#import                

#import "Html_Page_To_Csv.mqh"
string Dwebpage( string fileContents) ; 
#import                           


void Send_Buy( char news_SB[200][7] )
{

if( IsTradeAllowed()  )

 for ( int a1016L = 0 ; a1016L = 10 ; a1016L++ ) 

{
Print( 
" Event N° " + a1016L 
+ "/n Date " +   news_SB[a1016L][1]

) ;


}

return ; 

}

void start() 
{
string fileContents16 = Dwebpage(fileContents_12) ;
char news_B[200][7] = FileToWrite( char news_B12[200][7], fileContents16 );
Send_Buy( news_B[200][7] ) ;

}


//+------------------------------------------------------------------+


A message is received with : undeclared identifier and unexpected token , for the array news_B12[200][7] .

How to set this EA ? 

Chunsheng Yang
179
Chunsheng Yang  
#include <Conversion_Datas_To_Mql4.mqh>
//#import "Conversion_Datas_To_Mql4.mqh"
//char FileToWrite(char &news12[200][7], string fileContents_F12) ; 
//#import                

 
#include <Html_Page_To_Csv.mqh>
//#import "Html_Page_To_Csv.mqh"
//string Dwebpage( string fileContents) ; 
//#import                           


void Send_Buy( char news_SB[200][7] )
{

if( IsTradeAllowed()  )

 for ( int a1016L = 0 ; a1016L = 10 ; a1016L++ ) 

{
Print( 
" Event N° " + a1016L 
+ "/n Date " +   news_SB[a1016L][1]

) ;


}

return ; 

}

void start() 
{
string fileContents16 = Dwebpage(fileContents_12) ;
char news_B[200][7] = FileToWrite( char news_B12[200][7], fileContents16 );
Send_Buy( news_B[200][7] ) ;

}
"import" is for dll, whereas "include" is for mqh.
Tidiane Traore
13
Tidiane Traore  

Thanks , I have set the Ea , the import is declared with the name of the file , and the return array is a double type with 2 dimensions , as said on mql 5 it is not possible to return an array with a function


Ea is set , I will let this on the markets for mql 5 . 

To add comments, please log in or register