Build Neural Network Indicator in MT4 using Neuroshell

Hi Superluz,

Thank you for you posting, for me it is a good start to try MT5 ...I will posting after the result using NS2 by next month..

Thanks
 
Hi everyone,
i read every page in this thread and i find it very interesting,now i can create and train NN thanks to you all,,but i still have one probleme and i need help from pro here,,i trained my NN and i use the code to bind betwin it and betwin rsi indicator i use the code found in this forum http://neuroforex.net/index.php?option=com_fireboard&Itemid=29&func=view&id=27&catid=10

but the indicator doesn't show the predicted value and i need someone to look in the code in tell me where the error is and help me to modify it.
Thank you in advance and sorry for my bad english.
 

Attachments

  • RSI-NN.mq4
    4.2 KB · Views: 486
Hi Ziko,

I checked the RSI-NN, you miss to define inarray as input to the net prior firing.
Basic creating NN indicator, please specify:
- What are the inputs?
- What are the outputs need to be predicted?
- Collect your data
- Train the network using your training data (shall not include data for OOS)
- Using NS2, you will get def file (dll file) for the net deployment which will be called in MT4
- Create the indicator/EA using trained net: from the code shown on your link, it also missing the code to state what are the inputs, i.e. inarray[] variables that you use to call ret=FireNet(netnumber, inarray, outarray);
those input and output shall be defined before you train the network.

regards,
Arryex
 
Thank you arryex for your answer,can you modify it if you know how,,i tried but it seems that i fail everytime when i try,,i'll be very gratefull for you,,thanks
 
Good afternoon arryex,

Began to study this thread and read up to where you are trying to post password-protected files.

What a feat to accomplish, to get the password?

Yours sincerely

Michael

(sorry for my english)
 
Hi Ziko,

To identify what are inputs and output prediction that you have, I need a data collector script. It will be difficult if only based on training data or def file.

Gafes, please tell me which file that you intend to open, sometime i lost them also.

Thanks
 
Hi Gafes,

I need quite long time to find and re upload my archive..Please find here attached my notes compilation (unprotected) as your request.

Enjoy for the reading...
arryex
 

Attachments

  • e-note collection.zip
    3.2 MB · Views: 434
Hi Gafes,

I need quite long time to find and re upload my archive..Please find here attached my notes compilation (unprotected) as your request.

Enjoy for the reading...
arryex

Many thanks Arryex,

I will delve into....

P.S. One of the files still has the password "GA optimization for Neural Network.pdf"

Kind Regards,

Gafes
 
Hi Gafes,

Oops sorry missed that one..

See attachment.

Arryex
 

Attachments

  • GA optimization for Neural Network.pdf
    440.4 KB · Views: 898
Hi arryex,thank you for your answer
for the input i use (open(1),close(1),high(1),low(1),volume(1),rsi(periode:14,price_open,1))and(open(0),rsi(period:14,price_open,0)) and for the input i use (rsi(14,price_open,-1))
to resume i use the last bar input and the input of the opening of the current bar to predict tha value of the open price rsi,that makes 8 input and 1 output,, the script that i use is in the attachement..
Thanx for your help
 

Attachments

  • RSI_to_File.mq4
    3.2 KB · Views: 345
Hi Ziko,

From your explanation:
- 8 inputs NN: open(1),close(1),high(1),low(1),volume(1),rsi(14,price_open,1))and(open(0),rsi(period:14,pr ice_open,0), i.e. previous O,H,L,C,V,RSI, current O and RSI.
- 1 output NN: rsi(14,price_open,-1), i.e next bar RSI as prediction objective.
Unfortunately your script code is not reflecting your NN data, then you need to modify the csv file with other editor (such as notepad or excel) to shift data (previous bar) and predicted RSI. If you do not careful it may generate a wrong NN data.

Refer to your EA code(RSI_NN.mq4), prior code
ret=FireNet(netnumber, inarray, outarray);

You should define the inarray, such as:
for (int i=size-1;i>=0;i--)
{
inarray[0]= iOpen(SymbolName,PeriodMinutes,i+1);
inarray[1]=iLow(SymbolName,PeriodMinutes,i+1);
inarray[2]=iLow(SymbolName,PeriodMinutes,i+1);
inarrya[3]=iHigh(SymbolName,PeriodMinutes,i+1)
inarray[4]=iClose(SymbolName,PeriodMinutes,i+1);
inarray[5]=iVolume(SymbolName,PeriodMinutes,i+1);
inarray[6]=iOpen(SymbolName,PeriodMinutes,i);
inarray[7]=iRSI(SymbolName,PeriodMinutes,14,PRICE_OPEN,i)
}

I am not expert in MT4 coding, I hope someone can modify your code precisely. Please use my first attachment (thread 1) as your reference.

Arryex
 
Anyone can help me with my indicator ,,i still an amateur in programmation
Thank you
 
Anyone can help me with my indicator ,,i still an amateur in programmation
Thank you
Hi Ziko.. We are all amateurs here.:D
You have done good work here, but you have not completed it. Your indicator is difficult to fix without significant changes. I assume that your goal is to display a plot of the predicted RSI of next bar open. You should calculate the set of inputs defined in your script, feed these to a net, and read the result from the net.

Let me suggest some changes in psuedo code:
In the start() sub:
Code:
for each bar {
	calculate each input (use the script calculations as arryex has shown in his post)
	fill the inarray with these calculations as arryex has shown in his post
	fire the net
	read the net output in the outarray  (x=outarray[0];)
	set the indicator buffer to this output (RSIBuffer[i] = x;)
}
if you want to display a smoothed version of the net output, then use something like
SRSIBuffer = iMAOnArray(RSIBuffer[],,,,i);

MT4 code is difficult to debug because there is no IDE. You must use trial and error to find bugs. Usually this involves 'Print' statements in the code. Then you run the code and read the printed results in the 'experts' tab. Here I would suggest that you print several of the inarray values and check them against the variables used to train the net. If they are OK then chances are that the net output will be OK. You should print some of the output values just to check.

No one can accurately change your indicator and debug the changes without the def file and the input and output of the net when it was trained. In any case, you will understand the results and use them better if you make the changes yourself.

Now just a simple question. Why do you want to predict the RSI of the open? The open is almost always = close. So you might get better results using the RSI(,,,close,,) than a network prediction.
 
Now just a simple question. Why do you want to predict the RSI of the open? The open is almost always = close. So you might get better results using the RSI(,,,close,,) than a network prediction.
I meant that the open is almost always = close of previous bar (hence it is known). But perhaps you are trying to predict the RSI(open) several bars in the future.
 
yes it's true fralo the open of the predicted bar=the close of the current bar it's the same,,for the moment i just try to predicted one bar in the future but next it will be more,,,and i changed from rsi open price to the close price,, i use input like this:
open(1)close(1)high(1)low(1)volume(1)rsi open price(1)rsi close price(1)open(0)rsi open price(0)
and one output:
rsi close price of the current bar
that make me 9 input and 1 output
do you think that you can make me an indicator using this inputs to show the value of the output?
i tried many times but i think that i can't made it,the def file is in this link
http://www.mediafire.com/?8bdak7vjcemt90i
i don't know why the def files are not accepted in the attachement
thank you.
 
Last edited:
Top