Why would an ongoing optimization stop by itself and give "Optimization stopped due to a fatal error in the EA" ??

Back to topics list To post a new topic, please log in or register
avatar
59
investguy 2015.01.14 21:25
 

Hi,

 

Im receiving the following error during pass 5++(more than 500) on my ea.  

 "Optimization stopped due to a fatal error in the EA"

 

Im thinking that one of the parameters from the optimization is forcing a zero divide on the program... 

 What else could it be?

 

 

Thanks 

avatar
2017
gooly 2015.01.14 22:10 #
 
Can't tell you anything due to the information you gave us...
avatar
12992
WHRoeder 2015.01.14 22:20 #
 
investguy: Im thinking that one of the parameters from the optimization is forcing a zero divide on the program... 
Divide by zero is the reason. Parameters are irrelevant. What happens if Open==Close
avatar
59
investguy 2015.01.14 22:25 #
 

I'll change my question... is there a way to know the CURRENT(before being displayed on the results) optimization pass settings??

 

Thanks 

avatar
59
investguy 2015.01.14 22:26 #
 
WHRoeder:
Divide by zero is the reason. Parameters are irrelevant.

Due to the current parameter tested? Why it didnt give a error on the first pass ? 

thanks 

avatar
59
investguy 2015.01.15 00:19 #
 

Hi,

 So far i have isolated the one setting that is giving me a hard time, in order to do that.

1) testing with open prices only i selected a weekly period of time at a time util i got to the day it give me the error

2) unselecting the variables to optimize i got to the ones that matter 

3) unselected the genetic optimization option.

 

With those settings in hand...

 

Testing the ea will NOT give me an Zero Divide Error. The ea just hangs.

Could it be a logical loop now??

 

 

 

avatar
59
investguy 2015.01.15 00:37 #
 

Found the solution...

 

The optimization stopped due to the price being equal to opening price of a pending order... here is the solution:

if(BuyOnly)
           {
            if(Ask<ma) ticket=open(OP_BUYSTOP,ilots,ma,stoploss,takeprofit,expire,Blue);
            else if(Ask>ma) ticket=open(OP_BUYLIMIT,ilots,ma,stoploss,takeprofit,expire,Blue);
            else if(Ask==ma)ticket=open(OP_BUY,ilots,ma,stoploss,takeprofit,expire,Blue);
           }
         else
         if(SellOnly)
           {
            if(Bid>ma) ticket=open(OP_SELLSTOP,ilots,ma,stoploss,takeprofit,expire,Red);
            else if(Bid<ma) ticket=open(OP_SELLLIMIT,ilots,ma,stoploss,takeprofit,expire,Red);
            else if(Bid==ma) ticket=open(OP_SELL,ilots,ma,stoploss,takeprofit,expire,Red);
           }
         else
           {

 

 

Thank you all who helped! 

 

  

Back to topics list  

To add comments, please log in or register