help, this EA cant run (zero divide)

 

this attached ea is free from local forum, created by jjsmads.


but in my mt4, from various broker, it cant run, always said "zero divide" on jornal. please help. thx.

 
double SlopeDown1 = 10000*(DownFractal-DownFractal2)/(DownBar-DownBar2);
double SlopeDown2 = 10000*(DownFractal2-DownFractal3)/(DownBar2-DownBar3);
double SlopeDown3 = 10000*(DownFractal-DownFractal3)/(DownBar-DownBar3);

No checks, add them.

Hard coded numbers 0.00001 Point pairs only.

 

so, if iam using 4digit broker, should change to

like this? 1000 or 100000 ?

double SlopeDown1 = 1000*(DownFractal-DownFractal2)/(DownBar-DownBar2);
double SlopeDown2 = 1000*(DownFractal2-DownFractal3)/(DownBar2-DownBar3);
double SlopeDown3 = 1000*(DownFractal-DownFractal3)/(DownBar-DownBar3);
 

i have change to 1000 and 100000, for that slopedown, slopup, slopcross,

but still zero divides error..

can anyone upload fixed mq4 ?? thx you so much..

 
Since there are no slaves here, there are only two choices: learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you. Post your attempt and the nature of your problem.
 

sory, doesnt mean that way,,


anyway thx for ur reply,, :)

i ll take learn path..

 

To find out what is happening in the code use the Print statement.

also before letting a value or a result divide numbers use if ( value == 0.0 ) /* then */ print("Hey can't dvide by zero do something else") ;

Reason: