NeuroShel2 dll import into MT4

This is a discussion on NeuroShel2 dll import into MT4 within the Trading Systems forums, part of the Methods category; Hello! I am trying to use ns2-32.dll from NeuroShell to use my neuro network in Expert Advisor MT4 but every ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Jul 6, 2010, 6:43pm   #1
 
2 Posts
Joined Jun 2010
NeuroShel2 dll import into MT4

Hello!

I am trying to use ns2-32.dll from NeuroShell to use my neuro network in Expert Advisor MT4 but every time when I use that code in my EA it couses Critical Error and MT4 is jamed.

May be there is someone who did it already with sucsess.
That code have to read file for example test.def which is generated by NeuroShell2 and it contains data like netnumber, n_input number of neurons of inputs and n_out number of neurons of outputs.
But always there is error of OpenNet.
What is wrong with it?

#import "NS2-32.dll"
int OpenNet(string defpath, int& netnumber[1], int& n_input[1], int& n_out[1]);
int FireNet(int& netnumber[1], double& inarray[], double& outarray[]);
int CloseNet(int& netnumber[1]);
#import

............................

//------------------------------------------------------------------+
int ret;
int netnumber[1], N_in[1], N_out[1];
double inarray[],outarray[];
string defpath="C:\NeuroShell\test.def";
//------------------------------------------------------------------+
................................

int init()
{

..........................................

ret=OpenNet(defpath, netnumber, N_in, N_out);
if (ret!=0 )
{
Print("Ошибка!!! ret= ",ret);
return(0);
}
else
{
ArrayResize(inarray,N_in[0]);
ArrayResize(outarray,N_out[0]);
N=N_out[0];
}
//-------
return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
CloseNet(netnumber); // close the network
//----
return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----------------------------------------------------------------+
if (ret!=0) { return(0); }
//----------------------------------------------------------------+
int ret_F;
............................
............................
ret_F=FireNet(netnumber, inarray, outarray);
...........................
if (ret_F!=0 )
{
Print("Error!!! ret_F= ",ret_F);
return(0);
}
.........................
.........................

return(0);
}

Thanks!!
Sugus is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone post an example of a C/C++ DLL that can be called from EasyLanguage? snackly Trading Software 2 Mar 15, 2009 6:43am
Tradding DLL singh2jatt Trading Software 1 Mar 8, 2009 8:15pm
DLL - Strategy Alert YachtFund Trading Software 0 Apr 3, 2006 11:54am
DLL download kent Techies Corner 4 Mar 18, 2003 12:40pm

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)