Problem with matlab conection

 

Hi,

 

I've made a program in Matlab that works quite good, the problem now is that i have to connect it with metatrader.

If I create a function (.m) call [output]=trade4(input) where imput and oputput are double. Then I generate a .dll with the program in 32 bits ,  as meta-trader4 need,  that include everithing the function is supouse to need. ( I used the matlab compiler for compiling C++)

 

Then i call it with the import function with the next code:

 

#import "tradelibrary.dll"

double    trade4(double);

#import 



The program recognice the library but i dont know why it returns this error:   Can't not find "trade4" in  "tradelibrary.dll"

 

Can someone that already made this help me? I was searching for old answer but in all of the problems Metatrader didnt recognice the library, in my case it doesnt recognise the function should i call it other way? should i do something different?

 

thanks for answering