Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #631 (permalink)  
Old 01-27-2009, 02:46 PM
Senior Member
 
Join Date: Dec 2008
Posts: 132
finimej is on a distinguished road
When the trainer has the class, then the EA can do the sell operation on the trained period. The EA only does the buy operation on the untrained period. So I tried to debug the code from PACO, Paco Hernández Gómez - Using a PNN (Probabilistic Neural Network) and MetaTrader 4 (MQL4) to trade Forex

in the file pnn.mq4
Quote:
int PNNClassifyVector(double vector[]) {
double length = ArrayRange(vector, 0);

double result = -99999999999999999999;
int resultClass = -1;
Print("result start =", result);
double fx[2] = {0, 0};

double classVectorCount[2] = {0, 0};

for (int i = 0; i < ArrayRange(pnn, 0); i++) {

int class = pnn[i][0];

double classVector[60];
for (int j = 0; j < length; j++) {
classVector[j] = pnn[i][j + 1];
}

classVectorCount[class]++;

fx[class] += MathExp((-1) * euclideanScalarProduct(vector, classVector) / (2 * MathPow(SIGMA, 2)));
}

for (i = 0; i < ArrayRange(fx, 0); i++) {
fx[i] *= 1 / (MathPow(2 * 3.14159265, length / 2) * MathPow(SIGMA, length)) * (1 / classVectorCount[i]);
Print("check point 1 result fxi = ",fx[i], ", result=",result, ", SIGMA=",SIGMA,", length=",length, ", classvectorcount=",classVectorCount[i]);

if ((fx[i]> result) && (fx[i] != result)){
Print("pre check point 2, fxi = ",fx[i], " > result=",result, ", i=",i,", resultClass=",resultClass);
result = fx[i];
resultClass = i;
Print("after check point 2=fxi = ",fx[i], " , result=",result, ", i=",i,", resultClass=",resultClass);
}
}
Print("check point 2 result fxi = ",fx[i], ",resultClass=",resultClass);
return (resultClass);
}
then I have the output on the trained area, see attached the picture.

when fx[1]=0, result =0, the if (fx[i]> result) gives TRUE! and let it pass the condition check, unbelievable. speakless! And this only happened on the trained period. It's never happend on the untrained period.

Can someone help to debug this?
Attached Images
File Type: jpg debug.jpg (23.0 KB, 601 views)

Last edited by finimej; 01-27-2009 at 02:50 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #632 (permalink)  
Old 01-27-2009, 04:54 PM
Senior Member
 
Join Date: Dec 2008
Posts: 132
finimej is on a distinguished road
The Comez code has problem with the classification there. It only does buy operation outside trained period. Tried to debug whole day, and still not get the real problem solved.

From the russian forum here, get the modified PNN eric code. it uses the parzen window classification. The results is so so from backtest.

As for any Parzen window classificator, your will have the sigma problem, what value for the sigma is best for current priod? I optimized it, and get the result 0.03 for EURUSD M15.
Attached Files
File Type: mq4 PNNeric.mq4 (5.6 KB, 117 views)

Last edited by finimej; 01-27-2009 at 05:01 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #633 (permalink)  
Old 01-27-2009, 07:13 PM
Senior Member
 
Join Date: Dec 2008
Posts: 132
finimej is on a distinguished road
Link here is from codebase, he is using MACD and IMA matrix to calculate the Euclidian distance between trained vector and the test vector, good think so, need to be inproved. He is not using the parzen window classificator, but that just one step away.

What he is doing is he has a function that calcuate euclidean matric. So now we can go back to develope the PNNeric.mq4 above, to handle a matrix with iMA. Am I on the right track?
Quote:
double Euclidean_Metric(double&X_Data_Base[][v_dim_x], double Vector[v_dim_x],int num_v)
{
int i=0,i1=0,i3,i2,i4;
double Metric[1];
double t,sum;
ArrayResize(Metric,num_v);
ArrayInitialize(Metric,0.0);

for(i=0;i<num_v;i++)
{
for(i1=0;i1<v_dim_x-1;i1++)Metric[i]+=MathPow(X_Data_Base[i][i1]-Vector[i1],2);
Metric[i]=MathSqrt(Metric[i]);
}

//sort by ASCEND Metric
for(i3=0;i3<num_v-1;i3++)
for(i2=i3+1;i2<num_v;i2++)
if(Metric[i3]>Metric[i2])
{
t=Metric[i3];
Metric[i3]=Metric[i2];
Metric[i2]=t;
for(i4=0;i4<v_dim_x;i4++)
{
t=X_Data_Base[i3][i4];
X_Data_Base[i3][i4]=X_Data_Base[i2][i4];
X_Data_Base[i2][i4]=t;
}
}
sum=0;
for(i=0;i<Num_neighbour;i++)
{
sum+=X_Data_Base[i][5];
//Print(X_Data_Base[i][5]);
}
return(sum/Num_neighbour);
}
Attached Files
File Type: mq4 Stat_Euclidean_Metric.mq4 (13.0 KB, 65 views)

Last edited by finimej; 01-27-2009 at 08:43 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #634 (permalink)  
Old 01-27-2009, 10:04 PM
Senior Member
 
Join Date: Dec 2008
Posts: 132
finimej is on a distinguished road
I found attached powerpoint presenation helped me understand more about parzen window classification.
Attached Files
File Type: zip DHSch4part1.zip (472.9 KB, 144 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #635 (permalink)  
Old 01-27-2009, 10:14 PM
Senior Member
 
Join Date: Dec 2008
Posts: 132
finimej is on a distinguished road
attached is the parzen window classification functions for matlab
Attached Files
File Type: zip ParzenPNN.zip (14.4 KB, 72 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #636 (permalink)  
Old 01-28-2009, 07:11 AM
Senior Member
 
Join Date: Mar 2006
Posts: 1,069
barnix is on a distinguished road
PNN from:
Neuro Forex RealTime :: Âåðîÿòíîñòíàÿ ñåòü íà MQL4 [6]
Attached Files
File Type: mq4 #PNN_ARTIFICAL_N2.mq4 (5.1 KB, 106 views)
File Type: mq4 #PNN_ARTIFICAL.mq4 (4.6 KB, 91 views)
File Type: mq4 #_Lib_Kohhen.mq4.mq4 (9.3 KB, 88 views)
File Type: mq4 ExamplePNN.mq4 (22.8 KB, 92 views)

Last edited by barnix; 01-28-2009 at 07:32 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #637 (permalink)  
Old 01-28-2009, 08:22 AM
Senior Member
 
Join Date: Mar 2006
Posts: 1,069
barnix is on a distinguished road
Neuro Forex RealTime :: Ïðî âåéâëåòû íà MQL
Attached Images
File Type: gif pnn_2.gif (53.2 KB, 498 views)
Attached Files
File Type: mq4 iWavelet.mq4 (6.5 KB, 104 views)
File Type: rar kalman-type-filtering-using.rar (217.5 KB, 138 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #638 (permalink)  
Old 01-28-2009, 10:44 AM
mystified's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 190
mystified is on a distinguished road
Barnix,

İs it possible for you to combine Wavelet with KalmanGain: http://www.forex-tsd.com/140057-post52.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #639 (permalink)  
Old 01-28-2009, 05:16 PM
Senior Member
 
Join Date: Mar 2006
Posts: 1,069
barnix is on a distinguished road
Print Matrix elements script example
Attached Images
File Type: gif pnn_3.gif (13.3 KB, 451 views)
Attached Files
File Type: mq4 Matrix1.mq4 (1.2 KB, 39 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #640 (permalink)  
Old 01-29-2009, 09:41 AM
Senior Member
 
Join Date: Mar 2006
Posts: 1,069
barnix is on a distinguished road
Normalize Matrix Columns (Script Example)
Attached Images
File Type: gif pnn_4.gif (14.9 KB, 408 views)
Attached Files
File Type: mq4 Matrix2.mq4 (12.1 KB, 42 views)

Last edited by barnix; 01-29-2009 at 09:57 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
better ea, neural network, svm forex, cache:Jtu9ppOwDvsJ:www.forex-tsd.com/expert-advisors-metatrader-4/11096-better-nn-ea-development.htm, better, nn ea, better ea development, forex better ea, cortex, forex, Better NN EA, better development, better NN development, wackena NN-EA, libsvm, ea better, kalman, auto-scalper, Forex Auto-Scalper, search, Abdul Rahman EA Forex, fapturbo, betterea, GaussPNN, neuro, MT4_FANN, Auto-Scalper.ex4, better nn, Matrix NN ea


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BrainSystem: indicators development newdigital Brain Systems 58 08-22-2009 09:52 PM
Zigzag system development newdigital Indicators - Metatrader 3 14 05-20-2009 05:52 AM
StochThreshold | ... under development wibitiens Indicators - Metatrader 4 0 05-26-2007 03:26 AM
Brainwashing: system development newdigital Brain Systems 45 11-24-2006 12:55 PM
Help with simple EA idea development Spider4896 Metatrader 4 2 04-21-2006 02:23 PM


All times are GMT. The time now is 09:41 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.