Download MetaTrader 5

Indicators: Next price predictor using Neural Network - page 3

To add comments, please log in or register
Joe Chalhoub
33
Joe Chalhoub  
gpwr:
acholin:

HOW do you INSTALL this? I have been trying for a long time. Please advise so that your program is actually workable. A lot of people have already found it difficult to work your code. Please assist in installing everything including the zip file content.

Here is the tutorial on how to work with DLL's:


Here are my own steps for creating and compiling DLL's in MSVC9:

Making DLL:
-----------
Create Project... - Win32 Project (type name) - Select DLL & finish
Type code in name.cpp after #include "stdafx.h":

MT4_EXPFUNC void __stdcall function_name(double* x, ...)
{
}

Modify stdafx.h to contain:
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN
#define MT4_EXPFUNC __declspec(dllexport)
#include <windows.h>
#include <math.h>

Project - Add New Item - Module Definition File(.def) - Type name
In name.def add line:
EXPORTS function_name

Settings:
---------
Build - Configuration Manager - Active Solution Configuration: Release
Project - Properties - Configuration: Active(Release)

Project - Properties - C/C++ - Code Generation
Runtime library: Multi-threaded(/MT) - will include dependencies

Project - Properties - Linker - Input
Module Definition File: .\name.def

Using DLL:
----------
Copy name.dll from \Projects\name\Release to \experts\library
Opend EA mq4 code and add

#import "name.dll"
double function_name(double x[], ...);
#import

In MT, Tools - Options - Expert Advisors - Allow DLL imports

This is as far as I go. I am not here to tutor you how to use MT, DLL or write and compile C++ codes. If you don't know MQL4 and C++ programming, then these codes are not for you. If you still have a strong desire to use them, then take programming lessons. There is also an MT support forum


You can post your MT-related questions there.

One more thing. I am not affiliated with creators of MT (metaqoutes) and I am not paid for posting my codes here. I am doing it in my free will. I may decide to remove these codes if I receive too many complaints.

It seems you don't how to help. You have posted a wrong BPNN.dll file. I will post in the forum the appropriate dll and mq4 files for the Neural Network.

Zenoni
80
Zenoni  

Thank you for you answer!

I made a fresh FXCM install and installed the latest files from Forum  but I still get an error message. I applied it to the EUR/USD pair. I even turned off the windows firefall, but still I get an error.

I test this with another computer also and it worked very well. I don't know what is causing the error, this can be related to the hadware, drivers, software etc.


There has been a critical error
Time : 2009.08.27 13:49
Program : Client Terminal
Version : 4.00 (build: 225, 10 Jul 2009)
OS : Windows XP Professional 5.1 Service Pack 3 (Build 2600)
Processors : 1 x X86 (level 6)
Memory : 1048048/378104 kb
Exception : C000001D
Address : 10001C56
Access Type : NA
Access Addr : 00000000

Registers : EAX=01CD72D0 CS=001b EIP=10001C56 EFLGS=00010202
: EBX=00120548 SS=0023 ESP=00120480 EBP=00120538
: ECX=00000001 DS=0023 ESI=022840E8 FS=003b
: EDX=02283C30 ES=0023 EDI=00000000 GS=0000

Stack Trace : 004588B5 00463E17 00455691 01D9C568
: 0048BBC0 BE8D016A 00000000 00000000
: 00000000 00000000 00000000 00000000
: 00000000 00000000 00000000 00000000

Modules :
1 : 00400000 002B1000 c:\fxcm mt4 powered by bt\terminal.exe
2 : 00C40000 000D6000 c:\program files\tall emu\online armor\oawatch.dll
3 : 01510000 002C5000 c:\windows\system32\xpsp2res.dll
4 : 10000000 0001C000 c:\fxcm mt4 powered by bt\experts\libraries\bpnn.dll
5 : 5AD70000 00038000 c:\windows\system32\uxtheme.dll
6 : 5B860000 00055000 c:\windows\system32\netapi32.dll
7 : 662B0000 00058000 c:\windows\system32\hnetcfg.dll
8 : 71A50000 0003F000 c:\windows\system32\mswsock.dll
9 : 71A90000 00008000 c:\windows\system32\wshtcpip.dll
10 : 71AA0000 00008000 c:\windows\system32\ws2help.dll
11 : 71AB0000 00017000 c:\windows\system32\ws2_32.dll
12 : 71AD0000 00009000 c:\windows\system32\wsock32.dll
13 : 73DD0000 000FE000 c:\windows\system32\mfc42.dll
14 : 76360000 00010000 c:\windows\system32\winsta.dll
15 : 76380000 00005000 c:\windows\system32\msimg32.dll
16 : 763B0000 00049000 c:\windows\system32\comdlg32.dll
17 : 769C0000 000B4000 c:\windows\system32\userenv.dll
18 : 76B40000 0002D000 c:\windows\system32\winmm.dll
19 : 76F50000 00008000 c:\windows\system32\wtsapi32.dll
20 : 77120000 0008B000 c:\windows\system32\oleaut32.dll
21 : 773D0000 00103000 c:\windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll
22 : 774E0000 0013D000 c:\windows\system32\ole32.dll
23 : 77C00000 00008000 c:\windows\system32\version.dll
24 : 77C10000 00058000 c:\windows\system32\msvcrt.dll
25 : 77DD0000 0009B000 c:\windows\system32\advapi32.dll
26 : 77E70000 00092000 c:\windows\system32\rpcrt4.dll
27 : 77F10000 00049000 c:\windows\system32\gdi32.dll
28 : 77F60000 00076000 c:\windows\system32\shlwapi.dll
29 : 77FE0000 00011000 c:\windows\system32\secur32.dll
30 : 7C800000 000F6000 c:\windows\system32\kernel32.dll
31 : 7C900000 000B2000 c:\windows\system32\ntdll.dll
32 : 7C9C0000 00817000 c:\windows\system32\shell32.dll
33 : 7E410000 00091000 c:\windows\system32\user32.dll

Call stack :


gpwr wrote:

zenoni:

Hello

My metatrader hanged when I tried to use this indicator after I installed this as guided

  1. Copy enclosed BPNN.DLL to C:\Program Files\MetaTrader 4\experts\libraries
  2. In metatrader: Tools - Options - Expert Advisors - Allow DLL imports

I got this error:

It is hard to say what gone wrong. The problem with attaching a DLL to an MQL4 code is that any error inside a DLL will cause a crash without a clear message what happened. The most frequent one is trying to pass an array to the DLL of the wrong size. Try to reduce numInputs to 3 and see what happens.

MQL4 Comments
16316
MQL4 Comments  
I am very interested in your project. But I can not install it at all. Please explain me in detail. Please help me.
I want indicator or EA to make money or to +10 pip
Best
Ahmad Sheba
334
Ahmad Sheba  

Thanks very much for sharing this project.

I need to know from your experience, can someone use this type of Neural Networks (FFNN) to predect the EA will win or lose.(for example we train this type of Neural Networks when the EA will lose and when it will win with Stoploss and Takeprofit. or it just use for predect next price and there is another type of Neural Networks is using for this purpose?

Regards

MQL4 Comments
16316
MQL4 Comments  

If you arent smart enough to install this on your own you arent smart enough to know extrapolation of any kind has innaccuracies, and thus must be watched very closely so an EA would be inadvisable.

Aleksander Szablewski
23
Aleksander Szablewski  

Unfortunately it's not about recompiling the dll.

You use pointers in function declarations while MT4 doesn't allow this kind of access. In effect it crashes on memory access.

The dll code needs to be revised to allow the MT4 pass plain data structures.

What Mt4 version did you use to create the code?

ALX

MQL4 Comments
16316
MQL4 Comments  
zenoni:

Hello

My metatrader hanged when I tried to use this indicator after I installed this as guided

  1. Copy enclosed BPNN.DLL to C:\Program Files\MetaTrader 4\experts\libraries
  2. In metatrader: Tools - Options - Expert Advisors - Allow DLL imports

I got this error:

There has been a critical error

Time : 2009.08.23 12:39


Program : Client Terminal


Version : 4.00 (build: 225, 10 Jul 2009)


OS : Windows XP Professional 5.1 Service Pack 3 (Build 2600)


Processors : 1 x X86 (level 6)


Memory : 1048048/435488 kb


Exception : C000001D


Address : 10001EB6


Access Type : NA


Access Addr : 00000000



Registers : EAX=035E1E60 CS=001b EIP=10001EB6 EFLGS=00010202
: EBX=0012F5C4 SS=0023 ESP=0012F500 EBP=0012F5B8
: ECX=00000001 DS=0023 ESI=02254408 FS=003b
: EDX=02253C30 ES=0023 EDI=00000000 GS=0000

Stack Trace : 004588B5 00463E17 00455691 03530AE8
: 0048BBC0 BE8D016A 00000000 00000000
: 00000000 00000000 00000000 00000000
: 00000000 00000000 00000000 00000000

Modules :
1 : 00400000 002B1000 c:\fxpro metatrader\terminal.exe
2 : 00C40000 000D6000 c:\program files\tall emu\online armor\oawatch.dll
3 : 01510000 002C5000 c:\windows\system32\xpsp2res.dll
4 : 10000000 0001C000 c:\fxpro metatrader\experts\libraries\bpnn.dll
5 : 5AD70000 00038000 c:\windows\system32\uxtheme.dll
6 : 5B860000 00055000 c:\windows\system32\netapi32.dll
7 : 662B0000 00058000 c:\windows\system32\hnetcfg.dll
8 : 71A50000 0003F000 c:\windows\system32\mswsock.dll
9 : 71A90000 00008000 c:\windows\system32\wshtcpip.dll
10 : 71AA0000 00008000 c:\windows\system32\ws2help.dll
11 : 71AB0000 00017000 c:\windows\system32\ws2_32.dll
12 : 71AD0000 00009000 c:\windows\system32\wsock32.dll
13 : 72D10000 00008000 c:\windows\system32\msacm32.drv
14 : 72D20000 00009000 c:\windows\system32\wdmaud.drv
15 : 73DD0000 000FE000 c:\windows\system32\mfc42.dll
16 : 76360000 00010000 c:\windows\system32\winsta.dll
17 : 76380000 00005000 c:\windows\system32\msimg32.dll
18 : 763B0000 00049000 c:\windows\system32\comdlg32.dll
19 : 769C0000 000B4000 c:\windows\system32\userenv.dll
20 : 76B40000 0002D000 c:\windows\system32\winmm.dll
21 : 76C30000 0002E000 c:\windows\system32\wintrust.dll
22 : 76C90000 00028000 c:\windows\system32\imagehlp.dll
23 : 76F50000 00008000 c:\windows\system32\wtsapi32.dll
24 : 77120000 0008B000 c:\windows\system32\oleaut32.dll
25 : 773D0000 00103000 c:\windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll
26 : 774E0000 0013D000 c:\windows\system32\ole32.dll
27 : 77A80000 00095000 c:\windows\system32\crypt32.dll
28 : 77B20000 00012000 c:\windows\system32\msasn1.dll
29 : 77BD0000 00007000 c:\windows\system32\midimap.dll
30 : 77BE0000 00015000 c:\windows\system32\msacm32.dll
31 : 77C00000 00008000 c:\windows\system32\version.dll
32 : 77C10000 00058000 c:\windows\system32\msvcrt.dll
33 : 77DD0000 0009B000 c:\windows\system32\advapi32.dll
34 : 77E70000 00092000 c:\windows\system32\rpcrt4.dll
35 : 77F10000 00049000 c:\windows\system32\gdi32.dll
36 : 77F60000 00076000 c:\windows\system32\shlwapi.dll
37 : 77FE0000 00011000 c:\windows\system32\secur32.dll
38 : 7C800000 000F6000 c:\windows\system32\kernel32.dll
39 : 7C900000 000B2000 c:\windows\system32\ntdll.dll
40 : 7C9C0000 00817000 c:\windows\system32\shell32.dll
41 : 7E410000 00091000 c:\windows\system32\user32.dll

Call stack :

Hi did uyou solve the problem? I get the same

Aleksander Szablewski
23
Aleksander Szablewski  

Mr. gpwr,

You need to fix NN release (~NN).

Don't tell helpless users to fix your bugs. They don't even know what you're talking about.

The bug releases part of memory used by MT4 (or double free) and affects Windows GUI.
This is severe bug as it not only crash terminals but also can crash the whole Windows so all you can do is to press Reset button... and pray it will start up next time.

Fortunately I have Wndows box on VM :-) Poor Windows users...

Temp fix:

go to Train() and Test() and comment network release:

//bp->~NN();

Of course this will create memory leaks but it's enough to play with it for a while...

Ah, for those who just want the new dll: http://codebase.mql4.com/en/code/9599

ALX


MQL4 Comments
16316
MQL4 Comments  
It do not work; the red line change with every candle; you can test it with the estrategy tester in visual mode, just attach any EA and the indicator and look what happend. I test it for 4 months obviously with the strategy tester, and it have many fake and wrong signals; well at least in the pair EURUSD in H1
MQL4 Comments
16316
MQL4 Comments  

Dont function.

To add comments, please log in or register