Build Neural Network Indicator in MT4 using Neuroshell

I just found a new trading method to get larger profit shortly...
Previously I kept my position for several days to get small profit..now combination both methods should be the best

Arry what sort of sharpe ratio is your EA producing?
 
Hi Supremegizmo,

I do not know how to calculate sharpe ratio (like in NSDT), since everything done in MT4.
 
Gold Break New High.....takes trading benefit on the small time frame ...
 

Attachments

  • Trade 27 July 11.png
    Trade 27 July 11.png
    86.6 KB · Views: 633
US advance GDP q/q is worst than expected actual 1.3% vs forecast 1.7% and previous revised from 1.8% to 0.4% ...see the price action...
 

Attachments

  • US GDP Announcement-29 Jul 2011.png
    US GDP Announcement-29 Jul 2011.png
    50.3 KB · Views: 903
I closed all my stock open position...before Tsunami USA Default due date on 2 August 2011 and Moody rating downgrade....since I am not sure where ^JKSE wil go
at least 33% profit on hands..
 

Attachments

  • STOCK NET BALANCE 26 JULY 11.png
    STOCK NET BALANCE 26 JULY 11.png
    57.5 KB · Views: 579
I am working now in a new project to predict the JRSX indicator. This indicator is quite good to identify the price direction, example price will go up if JRSX cross above 50 and go down when the JRX cross below 50.
The idea is to predict earlier this JRSX indicator, hence we can put our entry trade in advance.
 

Attachments

  • JRSX.png
    JRSX.png
    46.9 KB · Views: 2,012
  • JRSX.ex4
    4.4 KB · Views: 410
Here is modified version of JRSX, with additional moving average option (SMA, EMA, LWMA, SWMA) and I add also the signal line when JRSX cross over with its selected moving average.

This JRSX is almost similar with Jurik RSX.
 

Attachments

  • aaJRSX SMMA.png
    aaJRSX SMMA.png
    90.8 KB · Views: 449
  • aaJRSX LWMA.png
    aaJRSX LWMA.png
    90 KB · Views: 656
  • aaJRSX EMA.png
    aaJRSX EMA.png
    90.4 KB · Views: 505
  • aaJRSX.png
    aaJRSX.png
    56.5 KB · Views: 636
Predict JRSX, using NS2 in XAUUSD 60 minutes data, 8549 rows:
1. Input: JRSX (t), JRSX (t+1),JRSX (t+2),JRSX (t+3),JRSX (t+4), JRSX(t+5)
afterward named them as variable I0 to I6
2. Output: JRSX(t-5) as variable O

Here is sample code defining input and output Neural network:
for( shift=i; shift>=1; shift--)
{
input[0] = iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift);
input[1] = iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift+1);
input[2] = iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift+2);
input[3] = iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift+3);
input[4] = iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift+4);
input[5] = iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift+5);
output[0]= iCustom(NULL,0, "aaJRSX", 0,14,0,0, shift-5);
}

3. Neural Network architecture in NS2: Back Propagation, Wards Net, 3 hidden slabs, 7 input neuron, 1 output neuron. Training criteria: rotation, turboprop, 80% data for training and 20% for testing.

See attached training data (in a zip), input-output and training result: I achieve only 0.6321 (less than 2 minutes optimization).
 

Attachments

  • aaNeuroJRSX2data.zip
    266.7 KB · Views: 374
  • Input Output.png
    Input Output.png
    18.8 KB · Views: 404
  • Training result.png
    Training result.png
    18.1 KB · Views: 524
  • Net configuration.png
    Net configuration.png
    15.8 KB · Views: 481
The next effort is to improve the R squared value by using other software..I choose Chaos Hunter.

As explained previously, I will use the predicted value in a prediction for the next prediction. If originally I have 7 inputs (I0 to I6), when a predicted value was found that I will use it as 8th input (I7), then retrain again to get new predicted value (I8), etc. I will posted the progress result ..
 
Market update: gold break new high, target price can be found using Fibonacci expansion.
 

Attachments

  • target fibonacci.png
    target fibonacci.png
    29.6 KB · Views: 1,480
  • market 2 Aug 11.png
    market 2 Aug 11.png
    53.2 KB · Views: 485
Here is my last modeling using Chaos Hunter..the R-squared now improved to 0.689

When the formula implemented into MT4, the predicted value almost 5 bars earlier than original JRSX (even with ripples).

After I do smoothing using MA methods the result is better.

The signal generated by smoothed predicted cross over with original JRSX is earlier than JRSX cross over 50.

The chart showing original JRSX, predicted JRSX with JRSX, and smoothed predicted JRSX with JRSX.

Conclusion: using predicted indicator as trading signal earlier than original one:smart:
 

Attachments

  • Model 5o.png
    Model 5o.png
    82.8 KB · Views: 518
  • JRSX-Predicted-Smoothed.png
    JRSX-Predicted-Smoothed.png
    24.1 KB · Views: 857
My trading method:
1. Define entry conditions:
- Follow the market trend (use long term indicator) in higher time frame
- Entry at cross over (use short term indicator) in lower time frame
- Support/resistance (Fibonacci, pivot, trend line, chart pattern) in higher time frame
- High volatility (use volatility indicator)

2. Define exit condition:
- Exit at cross over of short term indicator
- Exit at support resistance

3. Define stop loss

4. Money Management

5. Fundamental Economic News (rumors)

Here my sample defining entry and exit target using Fibonacci, if the price in correction use support as buy entry or resistance as sell entry. The next Fibonacci level become the exit target.
 

Attachments

  • Fibonacci SR.png
    Fibonacci SR.png
    35.9 KB · Views: 6,662
This is my last 2 days trading records..

My happy trading days...:clap::clap:
 

Attachments

  • Happy Trading 4-Aug-11.png
    Happy Trading 4-Aug-11.png
    90.6 KB · Views: 1,383
Using volatility based indicator helped me out from unnecessary ripples trade.
 

Attachments

  • Unnecessary ripples.png
    Unnecessary ripples.png
    43.2 KB · Views: 1,411
Hello 2 all .
After some discussion with Arry ,we came up with some ideas about implementing NOXA Cycles into Neural network.
The main problems to be solved are regime switching signal and repetitive cycles to which can be switched constantly(Using NN for finding the most appropriate one).There are some thoughts about using volatility or dislocation of components of the Cycle,in order to identify change in current market condition.I might also add Hurst exponent for finding deterministic market movement in order NOT to trade,when the market is in random walk state. Any ideas and proposals are welcome :)
Arry what do you think about using FXCorrelator for that matter ? This way we can detect volatility among all pairs to check whether only the trading pair is volatile or the entire market ?
BW,
Peter
 

Attachments

  • FXCORRELATOR.mq4
    4.2 KB · Views: 545
Hi Peter,

Welcome to our thread..Hope we can share and get benefit...

First think we should do is to have a same objective, implement on the same data, afterward each other can improve. Based on your explanation, correct me if I am wrong, your objective are:
1. To study all noxa cycles that repetitively occurred for certain market condition,
2. Put all noxa cycles as input of a neural network
3. You add Hurst component as part of input
4. etc

Let start with Data: which pair you intend to study? start with a single pair then try other pair after. If you already have data (example EURUSD 60 minute), please attach here. Then we will work on it. Complete this data with indicators that are used as inputs (all noxa cycles, Hurst, etc) and include also your output as target of your prediction.


I assumed that all works for charting is using Neuroshell Trader where Noxa and other indicators are available. You can also attach here a chart with data saved on it (I hope you already know how to do this).

About FXCorrelator, I need to know first in detail what for this indicator. Based on the code within indicator, each variables refer to subtraction of LWMA(i) - LWMA(i+delta), we define for each pair as A1, A2..A7. Then we subtract each pair value with average of others values.
then indicator value EUR = A1 - (A2+A3+A4+A5+A6+A7)/6; By the way I still do not know how we interpret this as volatility, I prefer to interpret this as currency strength.
If this indicator value for a currency pair is negative, means the differential LWMA is negative (down trend) and its value less than others pair average value. In reverse, if the indicator is positive means differential LWMA is positive and has larger value than other pairs average value and we conclude that this pair is in up trending.

Thanks
Arry
 
Thanks for the good summary Arry.
I've tested the cycles on many currencies.I've noticed that on some currencies and indexes(ETF's) they tend to last a bit longer(For example EURCHF,USDCHF,USDJPY).
About the TF,there are 2 opions :
- to swith between Timeframes in order to trade the best match cycle
- if used on one TF ,to wait until there is a clear cycle,which could be exploited for trading.There are periods in which there are no clearly identifiable cycler or no cycles at all.
I agree that we should sketch a model which both to follow in order to have consistency .

About the FXCorrelator ,I haven't looked into in in big details.The main disadvantage which i saw is the calculations : EUR = A1 - (A2+A3+A4+A5+A6+A7)/6; It creates a lot of unneeded noise in the system .I like the general idea behind this indicator,but not the way it is achieved and I believe,by following the principle ,it could be made a better indicator ,which could be used in the NN.
Over the next days I'll post some charts and ideas how to structure the inputs/outputs. I don't think we should put Cycles directly into the network,since they are not normalized.
Also i think there should be two NN's :
One to calculate the dislocation of components of the cycle,when there is locked cycle in the system,and other to find the best match cycle and TF (if a cycle becomes invalid on smaller TF,to look for best match on larger TF). Other ideas are welcome too. :)
BW,
Peter
 
Last edited:
Ok Peter..I I will wait for your data where we can start with..

Thank You
Arry
 
Ok Peter..I I will wait for your data where we can start with..

Thank You
Arry

Here is a suggestion along those lines for good models. The idea is that after sudden shifts in autocorrelation, price wants to revert to its mean.

First, choose a component group (do not use single cycles) and get the residuals from detrended price. Large values (poor fit) indicate a shift.
Second, make a prediction for price and get the errors.
Finally, plug both the residuals and the errors in an Ornstein-Ulembeck mean reverting model.

This can be done in full in Neuroshell. A suggestion though for your prediction. You’ll be better off with long term memory nets if you can.

Enjoy.
 
Top