Build Neural Network Indicator in MT4 using Neuroshell

Hi,

I try to display my neural indicator from the NS2 C code but not succeed. I have no problem to use dll.

Anybody can correct my indicator code?

Here attached 3 files:
1. aaNeuromar indicator.mq4 (placed in experts\indicator\)
2. aaNeuromar.mqh (placed in experts\include)
3. aaNeuromarlib.mq4 (placed in experts\library)

I use eurusd 1H chart for training the net.

Thank you for your kind assistance.
Arry
 

Attachments

  • aafirenetmar.mqh
    121 bytes · Views: 548
  • aaFirenetmarlib.mq4
    8.8 KB · Views: 565
  • aaNeuroMAR Indicator.mq4
    2.6 KB · Views: 526
Beware!!!

I believe Proteus indicator (http://www.intelligentsoftware.info/) is SCAM

Here is his reply when I send him an email
"Hello sir,
Your subscription will expire automatically this month, there is no need for you to do anything. If you wish to cancel, we will not send you any further updates, however since you’ve downloaded and installed it, you cannot reclaim your payment.

Kind regards,
Proteus Software
Email: [email protected]"


regards,
Arryex
 
Beware!!!

I believe Proteus indicator (http://www.intelligentsoftware.info/) is SCAM

Here is his reply when I send him an email
"Hello sir,
Your subscription will expire automatically this month, there is no need for you to do anything. If you wish to cancel, we will not send you any further updates, however since you’ve downloaded and installed it, you cannot reclaim your payment.

Kind regards,
Proteus Software
Email: [email protected]"


regards,
Arryex

If you paied by PayPal you can claim money back and explain them that it was a scam giving reference to this thread.

Krzysztof
 
Hi,

I try to display my neural indicator from the NS2 C code but not succeed. I have no problem to use dll.

Anybody can correct my indicator code?

Here attached 3 files:
1. aaNeuromar indicator.mq4 (placed in experts\indicator\)
2. aaNeuromar.mqh (placed in experts\include)
3. aaNeuromarlib.mq4 (placed in experts\library)

I use eurusd 1H chart for training the net.

Thank you for your kind assistance.
Arry

I think this is a fix.:)
 

Attachments

  • aaNeuroMAR Indicator.mq4
    2.6 KB · Views: 529
  • aaFirenetmarlib.mq4
    8.9 KB · Views: 494
Hi,

Thanks Fralo, with your code modification (new double Z for Real MAR calculation (iMA(12)/iMA(36)). It fix when the value of denominator is zero, by shifting to the next one .

When I run indicator, the predicted MAR only applicable at the last value only then on my chart the indicator displayed as a constant value (see attached picture). I wish to have the FireNet values for each bar and not at the latest one, compare with aaNeuroMACD.

I edit also: IndicatorBuffers parameter become 2; which previously set as IndicatorBuffers(1); hence only real MAR has been shown.

Thanks,
Arry
 

Attachments

  • MAR indicator rev 3 Dec 10.png
    MAR indicator rev 3 Dec 10.png
    29.4 KB · Views: 529
Last edited:
Hi,

Thanks Fralo, with your code modification (new double Z for Real MAR calculation (iMA(12)/iMA(36)). It fix when the value of denominator is zero, by shifting to the next one .

When I run indicator, the predicted MAR only applicable at the last value only then on my chart the indicator displayed as a constant value (see attached picture). I wish to have the FireNet values for each bar and not at the latest one, compare with aaNeuroMACD.

I edit also: IndicatorBuffers parameter become 2; which previously set as IndicatorBuffers(1); hence only real MAR has been shown.

Thanks,
Arry
Actually, I set it to the previous value. I did similar things in Firenet and tanh functions. You might want to use different default values there.

But I'm not sure why Firenet returns a constant. Notice that the constant returned is the maximum value 1.005901. That suggests that the output of firenet (netsum) is always over limit. Perhaps there is a problem in the Firenet function? Maybe you should compare it to the NS2 c code generator.
 
Hi Fralo,

Here is the c code generated. Since c extension is not allowed here then it changed as doc, rename it back to c and oven with notepad.

Yes, when I verified the last part of the code

outarray[0] = 1.166636E-02 * (outarray[0] - .1) / .8 + 0.9942346;
if (outarray[0]<0.9942346) outarray[0] = 0.9942346;
if (outarray[0]>1.005901) outarray[0] = 1.005901;

Means the output net will be set only between or equal to 0.9942346 and 1.005901, may be because i use the input as MA values and current MA is higher than MA used within training period.

Anyway, we learned something important here that it is not advised to use MA directly as an input NN since it might be lower/higher than MA values used during training period. I think there is no problem with the net but I made mistake to use MA or MA ratio as input of our NN.

Thanks,
Arry
 

Attachments

  • EURUSDMAR training data n14.doc
    8.2 KB · Views: 400
Last edited:
Hi Fralo,

Here is the c code generated. Since c extension is not allowed here then it changed as doc, rename it back to c and oven with notepad.

Yes, when I verified the last part of the code

outarray[0] = 1.166636E-02 * (outarray[0] - .1) / .8 + 0.9942346;
if (outarray[0]<0.9942346) outarray[0] = 0.9942346;
if (outarray[0]>1.005901) outarray[0] = 1.005901;

Means the output net will be set only between or equal to 0.9942346 and 1.005901, may be because i use the input as MA values and current MA is higher than MA used within training period.

Anyway, we learned something important here that it is not advised to use MA directly as an input NN since it might be lower/higher than MA values used during training period. I think there is no problem with the net but I made mistake to use MA or MA ratio as input of our NN.

Thanks,
Arry
You are quite right. To help with this issue, you might try to subtract some much slower average from the input so that you have something that is more stationary. Then you must just add the slower average back on to the predicted difference to get the predicted value. Alternatively, use the first difference of the series that you want to predict. That is usually quasi-stationary, but a little harder to predict.
 
Hi,

I made a new neural net with wider data (65000 rows as maximum capacity of NS2) from 1999.01.04 up to 1999.01.04 to cover max and minimum data. Mq4 indicators created in C code and dll code. Dll code is displayed successfully but on C code still giving a constant value (see attached picture).

Means using this code, neural network only fired one time at the last or some other problems happened.

Here I attached the indicator made based on generated c code (Sorry I could not share the dll, otherwise you compile the code).

Any one can advice?

Thanks
Arry
 

Attachments

  • aaNeuroMAR n14 c Indicator.mq4
    38.8 KB · Views: 476
  • MAR indicators C code vs DLL.png
    MAR indicators C code vs DLL.png
    20.8 KB · Views: 744
Hi,

I made a new neural net with wider data (65000 rows as maximum capacity of NS2) from 1999.01.04 up to 1999.01.04 to cover max and minimum data. Mq4 indicators created in C code and dll code. Dll code is displayed successfully but on C code still giving a constant value (see attached picture).

Means using this code, neural network only fired one time at the last or some other problems happened.

Here I attached the indicator made based on generated c code (Sorry I could not share the dll, otherwise you compile the code).

Any one can advice?

Thanks
Arry
Are you saying that you can call a DLL from MT4 and display the result, but when you implement the net in MT4 it does not display? If so the reason must be that the MT4 code is not exactly the same as the DLL.:confused:

If you have a method to decompile a DLL then you should get out of trading and sell the method.:)
 
Hi Fralo,

For your information, after training a net in NS2, it can produce in three version:
- DLL (can be called in C, VB, etc)
- C code (source)
- FLA, I use this to be implemented in excel directly.

I do not have capability to decompile dll, everything given from NS2. I still trying to find out how to call a function and passing array to generate an indicator.

thanks
 
Today concluded the final stage of the implementation of a probabilistic network PNN in MT4. Education Network is a manual directly in the NS2. Matrix of inputs generated using a stochastic oscillator. EURUSD 60 minutes.
 

Attachments

  • #_PNN_NS2_OPT1_EURUSD60_500.JPG
    #_PNN_NS2_OPT1_EURUSD60_500.JPG
    182 KB · Views: 941
Hi All,

While waiting Proteus displaying the benefits of his predicted MACD on EA, here I would like to shown you my own prediction with the trading strategy using NSDT.

As attached pictures, I did the following:
- Simply made predict the MACD and MACD signal
- Create trading strategy based on predicted signals
- Make a similar one in NS2 to make indicator in MT4

As the NSDT result:
1. Using predicted MACDs outperform compare to traditional one, especially on out of sample data. (see picture 1a and 1b)
2. 14.7% compare to 35.8% 1 year return on trade (see picture 2a and 2b)
3. Detail trade analysis for both trading strategy (see picture 3a & 3b)
4. Comparison of predicted data series and its trading signal (picture 4)
5. Detail predicted future values (picture 5)

3 month EURUSD hourly data used for training and out of sample started from 1st October.

On MT4, I made also other predictions :SMA upper chart (aaNeurotrend) and MACD (aaNeuroMACD)using Neuroshell2. Both are compared with original MACD and Proteus 5 including the 5 bar future values(see picture 6).

I have seen that on Proteus indicator, the past predicted value always be overwritten with the real MACD/MACD signals (repainted), accordingly I could not see the past comparison between predicted and real signal.

Arry

Arry 3 months OOS forecast? is this practical just out of curiousity asking(y)
 
Hi,

I try to make an EA using aNEuroMAR cross over, but seems still make mistakes. Only open Sell position but not Buy during cross above. It is my first EA (newbie), just edit he sample EA from MT4.

Here attached the EA code, any body can help why the buy signal is not generated?


Some pictures during simulation are attached here as well.

Thanks,
Arry
 

Attachments

  • NeuroMAR EA 0.png
    NeuroMAR EA 0.png
    20.7 KB · Views: 497
  • NeuroMAR EA 1.png
    NeuroMAR EA 1.png
    21.9 KB · Views: 426
  • NeuroMAR EA 3.png
    NeuroMAR EA 3.png
    79.4 KB · Views: 498
  • NeuroMAR EA 4.png
    NeuroMAR EA 4.png
    79.7 KB · Views: 563
  • aaNeuroMAR EA v 0.mq4
    4.7 KB · Views: 552
  • NeuroMAR EA.png
    NeuroMAR EA.png
    71.9 KB · Views: 544
Kohonnen neural network. The overall classification efficiency for optimal signal BUY/SELL - 87%. EURUSD60.
 

Attachments

  • KOHONNEN_EURUSD60_2000_OPT1_8_40_l1.JPG
    KOHONNEN_EURUSD60_2000_OPT1_8_40_l1.JPG
    189 KB · Views: 743
Here's another indicator on the network with the overall regression. Predicts MA. Parameter Predict - to predict how many bars, blue - AI itself, the red line - a prediction. Installation Instructions - on the first page.
 

Attachments

  • NSOP.zip
    110.8 KB · Views: 482
Top