Neural Network EMA system (NeuroTrend)

Arun,

I think your formula is just fine for the input range. The weight will be adjusting to the range without any problem I think.

The table looks quite good for a first NN. Since we use Jurik lib, we could replace the RSI with JRSX as it is smoother than standard RSI. Just an idea for refinement. The smoother the inputs, the better it usually gets even though NN are quite good at noise removal.

I have also seen that JNNS has the backpercolation algo which can be tried at a later stage. I don’t know much about it but I have read they are well suited for timeseries application.

I am still learning the JNNS but I have very limited time right now. I will try to keep up your pace…

Nabil,

I am not very familiar with the rainbow indicator but it is another approach. The inputs would be the difference between different MAs or many dEMA as direct MA values needs more retraining as the price falls out of bound of the network. The other problem is the quantity of inputs. You may end up with so many inputs that it will be impossible to train the network. An idea is to use the same training data over and over until it converges and it can be time consuming…

I don’t know how efficient the rainbow indicator is but it is certainly of interest, for a later stage maybe. If we find out the first network is good, I don’t know if we are to get down the rainbow path as it is quite long to do the work.

Cheers

@ All,

I spent some time yesterday and today to play with the dJMA indicator posted by pegasus200 for the output signal as discussed. I have changed the code and added the ATR channel for adaptive thresholding of dJMA output. After a couple of trials I think the settings are fine for the output. I would appreciate if others can play around and give me some feedback.

My results:

JMA period : 10
ATR period : 10

buy_frac = 0.5
sell_frac = 0.4

The various parameters you change are

Length = period for JMA and ATR calculation
Phase = smoothness of the curve

buy_frac = ATR channel upper band //vary between 0.1 to 1.0
sell_frac = ATR channel lower band //vary between 0.1 to 1.0

If thats fine I can start to create a network and train in this week. I think by next week we will have a new network based indicator. Any suggestions for a new name for the indicator guys???(got a bit excited)

@pegasus200,

Yeah we can replace RSI with JRSX. How’bt Bollinger Bands???
Best Wishes,
Arun

dJMAThreshold.zip (8.89 KB)

Arun,

I have played with JBands but I did not find it to be more accurate. The thing is that when you use the JMA as the average, you no longer get the standard deviation as the JMA moves much faster than SMA on rapid changes. I would use the original Bands.

I will try your modifed code and see how it does.

An interesting thing would be to use the strategy tester to find the best values. It would invole writing multiple files (I think you cannot get future values in the tester so you must use predefined files) with the shifted indicator values for different parameters values and then have the tester read the files one by one to get the indicator values. A variable in the tester would step through the different files and the best one would come out at some point… Just an idea. Manual inspection is also fine. Just in case someone has the time do try it.

For the new name, I think you should get the credit so you can leave the NeuroTrend name or use NeuroTrendv2.

Arun,

Found an error in your code. :stuck_out_tongue: (kidding!)

When you calculate JATR, the line is :

result = JJMASeries(0,0,MaxBar,limit,Phase,Length,currentPrice,bar,reset);

It should be:

result = JJMASeries(1,0,MaxBar,limit,Phase,Length,currentPrice,bar,reset);

I am now looking how you use the ATR as a threshold as the range must be different now!!

Arun,

Played with the indi (corrected one).

I also removed the Point in the ATR multiplication.

Now the values of buy and sell frac are about 20.

My setup is :

Length=10
buy_frac=5 to 15
sell_frac=5 to 15
shift (I put it back) = -2

This gives me a good setup as a signal to predict. The signal would be valid at the end of the bar (this justifies the -2 shift).

What do you think ?

just a thought i was getting worried from what i am understand maybe be wrong. it seems to no logic behind the neural network rather string of indicators with indicators. i am not here to make anyone feel bad or anything just some thoughts on the system. it necessarily may give results and not give the results depending on market conditions. it is just if train indicators it well to create a fit for recent market conditions rather holistic approach for trading.

@ Pegasus200,

The signal looks good now.Yesterday while analyzing something was pondering me that the ATR calculation might be wrong. But I was so confident on my coding that I did not take a chance to go through the code:(

Thanks for the corrections in the code. A value of 20 seems fine for me too. There are some false positive signals which cannot be avoided. If we use a wide band then we filter out also important buy and sell signals.

I use strategy tester to export the signals to pattern files of SNNS. Yeah you are right i cannot use shift, but I can store in variables before and then while writing to files shift the signals.

Best Wishes,
Arun

Please add hour of day (0-23) as an input into your neural network. It might be able to pickup additional patterns with it.

What software package are you using to train the network? I have a spare fast machine that I can leave running for a long time to help in training.

Marcin

mkurzawa2,

Adding hours is interesting to identify trading time where the market is most active. Since we already have JATR, I see it of less importance as JATR and BB will tell us when market is volatile.

Can be added but I doubt it will change anything.

although I installed all indicators and files according to your description, I get only the 5 ema on the chart. The other indicators are not shown in the chart.

Hi to all,
I really enjoy your progress on the BPNN and I wanted to become a contributor as well with my experience in NN development. At the moment I use FANN but I easily could give JNNS a shot. Or I could convert your script to FANN and see how the training goes with it.
Arun, could you post your JNNS script that you use to train your BPNN and generate your text weights file that you import in MQL? In this way we can easily modify the topology of your network and try different things that will give us a better edge. Thanks for sharing and good luck with the progress of the EA!

Hi Sam,

Did you already solve the problem in installing the indicator??? Please go through the instructions in the Instructions.txt. It should work well.

@ getsumpips,

Thanks for your interest in this work. I will post the script today when I am back at my home office. Initially I wanted to use FANN, but dropped my decision after playing with JNNS interface.I badly need support in the progress of this work as I am not able to make out time for coding. It would be great help if someone can extend my script for the new NN design.

@ All,

I was busy for the past days with other work and travel. Hopefully I will make out soem time this week and post my progress at the end of the week.

Cheers!
Arun

Looking forward to your script for JNNS. I will start your original NNS script and make some improvements there and then if needed I will port it to FANN or NeuroSolutions (which offeres much more powerful NN architectures). Any reason you stayed away from FANN? Thanks

Just installed the NeuroTrend indicators on my chart today and watched close to 150 pips go up and down today. will try out tomorrow and enter. no hitches on my installations

I wish some one would start a thread on NN 101 for newbies like me. i have been working on a system based on support and resistance and wouldn’t mind using NN on it

thanks Arun and every one who has posted any contributions here

@ All,

Attached is the script file to output signals for training. I did not add it to the main indicator as it would confuse the newbies.

@ getsumpips,

You seem to have experience in coding and writing interface files for various NN tool. Would you like to modify the attached script with the new design we have discussed in this thread. I would really appreciate if someone can give support in coding the export files.

Cheers!
Arun

NeuralTrainingsetCreator.zip (1.29 KB)

Hi Arun,
Thanks for the SNNS pattern generating script. When running it within the start() body you enter with “cnt” set to 0 and check for the following condition which could never be met: “if(cnt > 50){…}” since there is no loop for the “cnt” counter to be incremented. After 1 pass, start() is exited and nothing is written to the file. Can you check to see if this is the last version of the script you use? Also after the pattern file is generated it is loaded into SNNS which uses it to train and create the output weight file to be fed to the indicator? Just to make sure.
Of course I can help with the coding but I would like to have it running first as the original version and track changes from there. Thanks.

Thats the final version. It should work int the strategy tester. The cnt is incremented out of the condition. so writing happens only when cnt reaches more than 50.

if(cnt > 50)
{   
	
}
[B]cnt++;[/B]

I use this to make sure the signals are written to file after some Bars (50). Although a lesser value could be used. It is better to wait a while to output the signals of indicator as for some indicators, outputs are stable after some bars. Also most of the indicators are calculated on past values.

Cheers!
Arun

Hi Aroonraj:

I’m new here and I just found this thread. Very interesting to read.

First, let me say “thank you” for sharing your indicator/system. I’m a longtime trader, but to be honest, I don’t know a whole lot about neural nets. I plan on reading the tutorial you posted here to better educate myself.

I’ve installed the indicator/files/template, and going back through my 15m chart I can see that this system turns out some very nice trades.

I do have a question. If I understand correctly, the indicator must occasionally be “fed” new pricing information so that it can learn/relearn. I’m not sure how much info you feed it, but I thought I read “2 months” worth. I assume this must be done manually. Using 2 months as an example, Here’s my question:

Would it be possible to program the indicator so that the new information is “automatically” fed into the system? For example, at the start of each new day (00:00), the newest information is automatically fed into the system and the oldest information is dropped/deleted. Let’s say that you are using information ranging from July 1st - August 30th. At the end of the day on September 1st, the July 1st data would be dropped and September 1st data would be added, giving you a data range of “July 2nd - September 1st.” This way the indicator always has the newest, most relevant information. Hopefully this isn’t a stupid question. If I am misunderstanding the way this works then please just ignore my question.

As I stated before, I don’t know much about NN, but hopefully I can contribute in some way. Thanks again for sharing your indicator. I look forward to following this thread.

Regards,

CA

Hi CA,

Good to know that you are interested in the system and indicator. Currently we export the indicator outputs to a file. This file is then used to train the network in a different software (JNNS). But in a very very long term plan I want to program some training algorithms. Then it will be possible to do automatic or adaptive learning. Before I start implementing I want to know which algorithm works best for our model.

Cheers!
Arun