Build Neural Network Indicator in MT4 using Neuroshell

I found 70 + Matlab ebook, download it using torrent downloader (microtorrent, bittorent, vuze, etc)

rename file extension from *.txt become *.torrent, the open with torrent downloader, the file size is 748 MB.
 

Attachments

  • 70+ MATLAB Books.txt
    59.6 KB · Views: 448
I found a good ebook collection for matlab, it can be downloaded using torrent downloader (microtorrent, bittorrent, vuze, etc).

Rename attached file from *.txt to *.torrent then open it with torrent downloader. The file size is 748 MB.

After download completed, there will be 3 files:70+ MATLAB Books.uif, Torrent_downloaded_from_Demonoid.com.txt and List.txt.

uif file can be decompressed using Magiciso to become iso file, the isofile size baout 944.5 MB.

Magisiso can be downloaded from http://www.brothersoft.com/magic-iso-maker-59710.html
the serial can bee seen here: http://insansainsprojects.wordpress.com/2008/01/23/mengkonversi-uif-ke-iso/
 

Attachments

  • 70+ MATLAB Books.txt
    59.6 KB · Views: 379
Last edited:
Here is matlabr2011b

- Save attachment then rename Matlab R2011b.torrent.txt become Matlab R2011b.torrent.
- Run your torrent application (microtorrrent, vuze, bit torrent)

Voila..you get them..Size is 5.44 GB
 

Attachments

  • Matlab R2011b.torrent.txt
    151.3 KB · Views: 410
Here is mine after download and install it..

Let us start....
 

Attachments

  • R2011b.png
    R2011b.png
    244.9 KB · Views: 2,239
Here is my first journey using Matlab. I found the following Steps to train NN within matlab:
1. Export data from MT4 into matlab readable format, save it in the Matlab working folder
2. Import data into Matlab (generate script mode is preferable)
3. Create output variable from data
4. Allocate imported array to net variable names (input and output)
5. Train the net using any available network configuration/methods, then see the performance.

Next...collect the network data (weight and bias) to transfer back into MT4 (still find the way how to get them...)
 

Attachments

  • error histogram net1.png
    error histogram net1.png
    30.3 KB · Views: 810
  • train result net1.png
    train result net1.png
    29.5 KB · Views: 501
  • Train net3.png
    Train net3.png
    216.8 KB · Views: 556
  • Call the script.png
    Call the script.png
    43.8 KB · Views: 408
  • regression net1.png
    regression net1.png
    30.5 KB · Views: 482
  • training state.png
    training state.png
    30 KB · Views: 588
  • matlab script1.png
    matlab script1.png
    81 KB · Views: 1,548
Here is my first journey using Matlab. I found the following Steps to train NN within matlab:
1. Export data from MT4 into matlab readable format, save it in the Matlab working folder
2. Import data into Matlab (generate script mode is preferable)
3. Create output variable from data
4. Allocate imported array to net variable names (input and output)
5. Train the net using any available network configuration/methods, then see the performance.

Next...collect the network data (weight and bias) to transfer back into MT4 (still find the way how to get them...)

Perhaps in such approach would be better to use MBP as it can export trained net as C++ code than to make dll for MT4 or NS.

Anyway i think regression approach (predicting the value) wont be accurate enough to make any strategy profitable for significiant number of trades, at least it was not sucessfull for me at the time when i was trying it with MBP

Krzysztof
 
Hi Krzys,

Thank for advice..but I am still far to come there..

Now I just arrive to the stage where I can personalize my network configuration, such as modifying data processing (divide block instead random), training method (other than levenberg-marquardt) and other training parameter (epoch, time, performance, etc)...

Need more patient to start from the scratch...
 

Attachments

  • Edit training parameter.png
    Edit training parameter.png
    153 KB · Views: 533
I did the training with feedforwardnet using all available training algorithm.

Probably the net which give the largest R values on test data will give better prediction.
 

Attachments

  • Matlab Feedforward with all training algorithm.pdf
    219.9 KB · Views: 1,197
By tracing how the neural network configuration within matlab, finally I can make a script to generate cpp code from the neural network training result.

The cpp code is ready to be compiled to create dll, this dll is ready to call from MT4..

Here are the screen shoots..

Kryzs, finally I come to this point..to deploy trained net into dll ...:D
 

Attachments

  • dll produced.png
    dll produced.png
    11.8 KB · Views: 391
  • Generate dll.png
    Generate dll.png
    126.1 KB · Views: 604
  • generate c code 2.png
    generate c code 2.png
    121 KB · Views: 1,140
  • generate c code.png
    generate c code.png
    104 KB · Views: 512
  • Save the network data after NN training.png
    Save the network data after NN training.png
    81.1 KB · Views: 477
Here are mine's..Pat..please shown yours..PM me to open the pdf

But I do not care about the trade result..I really enjoy with current progress and trading development..
 

Attachments

  • real sample report.pdf
    17.2 KB · Views: 437
  • my gold.jpg
    my gold.jpg
    603.8 KB · Views: 519
Finally I get the dll form of trained neural network from Matlab, if I compare between NS2 and Matlab result:
- The code in Matlab has larger size since it build from 100 hidden neurons, while from N2 I have 63 hidden neurons with 3 slabs.
- Produced dll size with larger hidden neuron become large as well
- If I put both indicator at the same chart, indicate almost same values
- In term of time to display the indicator on the chart is in seconds, no delay for both of them.
In my case..either NS2 or Matlab both of them are good..
 

Attachments

  • dll file size.png
    dll file size.png
    5.1 KB · Views: 335
  • compare NS2 - Matlab dll indicators at same chart.png
    compare NS2 - Matlab dll indicators at same chart.png
    43.9 KB · Views: 2,059
  • compare NS2 - Matlab dll indicators-2.png
    compare NS2 - Matlab dll indicators-2.png
    44.1 KB · Views: 1,655
  • compare NS2 - Matlab dll indicators-1.png
    compare NS2 - Matlab dll indicators-1.png
    43.8 KB · Views: 627
  • code compare.png
    code compare.png
    50.1 KB · Views: 680
Too much stress is not good...time to relax..enjoy your favorite music..I play my itunes...
:cheers:
:cheers:
 

Attachments

  • intermezzo1.png
    intermezzo1.png
    1,006.6 KB · Views: 435
  • intermezzo2.png
    intermezzo2.png
    918 KB · Views: 396
Now I start to play with custom neural network configuration, I do not set the transfer function, all still set at default (linear transfer function).
Probably we can make other typical jump net, or recurrent jordan-elman, etc
 

Attachments

  • Custom Network1a.pdf
    770 KB · Views: 699
Great job arryex a lot of good work with Matlab. Anyway, with Matlab it is the end of the journey as it is the state of the art.

Unfortunately that is a journey with no end as the market continually drifts from one state to another.
 
I don't want to rain on your parade Arryex but I tried neural nets some years ago. They seemed to offer encouragement so I spent a lot of time on it but could really do no better than a moving average in results.

Perhaps they have improved but I haven't heard of it ?
 
This is the comparison result the NS2 neural network configuration made in Matlab, with some consideration:
- all transfer function in NS2 may not available yet in matlab, such as tanh15, symmetric logistic, gaussian, etc.
- Any single link in NS2 contains weight and bias, while in matlab we will have only a single bias in a layer. Means if you have two link into a slab then you will have 2 weight and 2 bias in NS2 but in matlab you will have 2 weight and 1 bias.
- Slab 1 in NS2 shall be considered as input normalization, then Slab N in NS2 equal to Layer N-1 in Matlab.

Please consider for educational purpose only, no intention in advising to use any software, technology, or trading ..you are responsible to your decision:D
 

Attachments

  • NS2 Net in Matlab.pdf
    2.2 MB · Views: 525
  • sample.png
    sample.png
    73.4 KB · Views: 774
Last edited:
This is the comparison result the NS2 neural network configuration made in Matlab, with some consideration:
- all transfer function in NS2 may not available yet in matlab, such as tanh15, symmetric logistic, gaussian, etc.
- Any single link in NS2 contains weight and bias, while in matlab we will have only a single bias in a layer. Means if you have two link into a slab then you will have 2 weight and 2 bias in NS2 but in matlab you will have 2 weight and 1 bias.
- Slab 1 in NS2 shall be considered as input normalization, then Slab N in NS2 equal to Layer N-1 in Matlab.

Please consider for educational purpose only, no intention in advising to use any software, technology, or trading ..you are responsible to your decision:D

Here is a link to MATLAB webinars related to finance. 2 webinars directly related to algorithmic trading

Recorded Webinars by Industry

Krzysztof
 
Top