The following was posted in the wrong section and removed by me. I am replicating it here as a "pocket" for the user in question, namely Earthy Stag beetle.
I have an interest in ML and found Next Price Neural Predictor, thanks & respect to Vladimir for this, I was going to use it as a working learning framework. gpwr released copyrighted source - I am very grateful. The indicator makes use of a dll with which I have little experience - however, I downloaded Visual Studio 2022 Community and rolled up my sleeves.
What could go wrong? 😂
I tried using the original compiled BPNN.dll first, but MT5 complained that it was a 32 bit dll, so I had to rebuild it to operate in today's MT5. I made a few changes to BPNN source, and rebuilt the DLL. Ace!
So I made a stab at porting the indicator to MQL5 - again something with which I am not familiar, but that went OK.
Next step was to try & run the MT5 indicator port, where i received the following error:
2025.10.1615:19:36.501 cannot find 'string BPNN64::Train(double&[],double&[],double&[],int,int,double&[],double&[],int,int&[],int,int,int,double)' in module 'BPNN64.dll'
OK, so the indicator was not able to find the functions in the DLL.
So I added some simpler functions to BPNN64 which also return strings, but do nothing useful to see f they would be resolved. Here they are:
#define STATUS_BUF_SZ 80
MT5_EXPFUNC wchar_t* __stdcall GetStringValue(wchar_t *spar)
{
static wchar_t status[STATUS_BUF_SZ];
swprintf_s(status, STATUS_BUF_SZ, L"%s %s", spar, (wchar_t*)L" it ...");
return(status);
}
MT5_EXPFUNC int __stdcall SetIntArrayValValue(constint *constLSz, constint constLSzSize, int *lSz, constint lSzSize, int val)
{
if (lSzSize < 1)
return -1;
lSz[0] = val;
return(lSz[0]);
}
And both these functions worked, by now I had knocked up a simple script which looks like this:
//+------------------------------------------------------------------+//| dll_test.mq5 |//+------------------------------------------------------------------+//+------------------------------------------------------------------+//| Tests dll import |//+------------------------------------------------------------------+#property script_show_inputsinputstring in_string ="Hello world"; // String to addinputint in_int =10; // int to return#import "BPNN64.dll"string GetStringValue(string);
int SetIntArrayValValue(constint &constlSz[], constint constlSzSize, int &lSz[], constint lSzSize, int val);
#import
voidOnStart()
{
string s = in_string;
string sret;
int lSz[80];
lSz[0] = in_int;
int int_ret;
//--- simple dll-functions call
sret=GetStringValue(s);
printf("%s[%d], %s: Orig string=%s, after GetStringValue=%s",
__FILE__, __LINE__, __FUNCTION__, s, sret);
int_ret = SetIntArrayValValue(constlSz, (constint)sizeof(constlSz), lSz, sizeof(lSz)/sizeof(lSz[0]), in_int);
printf("%s[%d], %s: input int=%d, after SetIntArrayValValue=%d, sizeoflSz[]=%d",
__FILE__, __LINE__, __FUNCTION__, in_int, int_ret, sizeof(lSz)/sizeof(lSz[0]));
}
//+------------------------------------------------------------------+
It worked! But that it worked puzzled me. I wrote a new dll containing just function calls of the form used in BPNN, called ParamsTest.
I wrote a new script to try and work out what is going on, and this is the debug I receive:
I have an interest in ML and found Next Price Neural Predictor, thanks & respect to Vladimir for this, I was going to use it as a working learning framework. gpwr released copyrighted source - I am very grateful. The indicator makes use of a dll with which I have little experience - however, I downloaded Visual Studio 2022 Community and rolled up my sleeves.
What could go wrong? 😂
I tried using the original compiled BPNN.dll first, but MT5 complained that it was a 32 bit dll, so I had to rebuild it to operate in today's MT5. I made a few changes to BPNN source, and rebuilt the DLL. Ace!
So I made a stab at porting the indicator to MQL5 - again something with which I am not familiar, but that went OK.
Next step was to try & run the MT5 indicator port, where i received the following error:
OK, so the indicator was not able to find the functions in the DLL.
So I added some simpler functions to BPNN64 which also return strings, but do nothing useful to see f they would be resolved. Here they are:
And both these functions worked, by now I had knocked up a simple script which looks like this:
It worked! But that it worked puzzled me. I wrote a new dll containing just function calls of the form used in BPNN, called ParamsTest.
I wrote a new script to try and work out what is going on, and this is the debug I receive:
I can't move any further until I understand why this is bombs out. So the following works OK:
But this doesn't:
From the DLL:
I would be very grateful for soeone's insight please. I'm formally stuck.
Things can be tough to find. I started out at mql4.com in 2011, and I migrated over to mql5.com in 2015. When I need something here, I do a web browser search for "mql5" and the name or subject of the thing. It's quite reliable.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
The following was posted in the wrong section and removed by me. I am replicating it here as a "pocket" for the user in question, namely Earthy Stag beetle.
Hello All,
I have an interest in ML and found Next Price Neural Predictor, thanks & respect to Vladimir for this, I was going to use it as a working learning framework. gpwr released copyrighted source - I am very grateful. The indicator makes use of a dll with which I have little experience - however, I downloaded Visual Studio 2022 Community and rolled up my sleeves.
What could go wrong? 😂
I tried using the original compiled BPNN.dll first, but MT5 complained that it was a 32 bit dll, so I had to rebuild it to operate in today's MT5. I made a few changes to BPNN source, and rebuilt the DLL. Ace!
So I made a stab at porting the indicator to MQL5 - again something with which I am not familiar, but that went OK.
Next step was to try & run the MT5 indicator port, where i received the following error:
OK, so the indicator was not able to find the functions in the DLL.
So I added some simpler functions to BPNN64 which also return strings, but do nothing useful to see f they would be resolved. Here they are:
And both these functions worked, by now I had knocked up a simple script which looks like this:
It worked! But that it worked puzzled me. I wrote a new dll containing just function calls of the form used in BPNN, called ParamsTest.
I wrote a new script to try and work out what is going on, and this is the debug I receive:
I can't move any further until I understand why this is bombs out. So the following works OK:
But this doesn't:
From the DLL:
I would be very grateful for soeone's insight please. I'm formally stuck.
Source is attached,
Code Base
BPNN MQL Predictor Demo with library
Stanislav Korotky, 2019.12.18 16:24
This is a demo indicator with BPNN neural network library ported from C++ to MQL.Thank you Ryan! I missed this, will have a try.
With my best regards, ESB.
Thank you Ryan! I missed this, will have a try.
With my best regards, ESB.
You're welcome, ESB.
Things can be tough to find. I started out at mql4.com in 2011, and I migrated over to mql5.com in 2015. When I need something here, I do a web browser search for "mql5" and the name or subject of the thing. It's quite reliable.