Hello Bass,
I interest your idea. After I test your EA, I found some problem.
1) Your fuzzy EA open only SELL order. I found the return value of FuzzyLogic()
function alway below 0.5. Then, I look into FuzzyLogic and found wrong
value and code
1.1) Size of Array variable in FuzzyLogic function are wrong.
1.2) I think values of Array arGator are wrong number, The SumGator variable
is too small (below 0.01)
1.3) The double loop before finish the function has wrong code.
for (x=0;x<5;x++)
{
for (y=0;y<5;y++)
{
Summary[x] = Summary[x] + Rang[y,x]*Weight[y];
}
}
for (x=0,Decision=0;x<5;x++)
{
Decision = Decision + Summary[x]*(0.2*(x+1)-0.1);
}2) In testing it generate many error order codes. I found your EA code
send Order to server more than one in single tick. In start() function
After it call CheckForOpen() function that send OrderSend() to server,
SetStopLoss() function is called and it send OrderModify() to server and then
it send OrderModify() in start() function again before finish. It send 3 order
to server in single tick!!!
if(CalculateCurrentOrders(Symbol())==0)
{
CheckForOpen();
return;
}
if (FirstSL==True)
{
if (SetStopLoss())
{
FirstSL = False;
}
return;
} In SetStopLoss() function has wrong code
StopLoss=NormalizeDouble(SL*Point,0);
It alway zero. I change to
StopLoss=NormalizeDouble(SL*Point,Digits);
Thanks