Forex
Google

Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-19-2007, 11:09 PM
deepdrunk's Avatar
deepdrunk deepdrunk is offline
Senior Member
 
Join Date: Apr 2006
Posts: 310
deepdrunk is on a distinguished road
zero divide

Hello,

recently i have the problem with couple of indicators ,they report 'zero divide'
but i am sure there is no division by zero.I checked history and all data is ok.
I tried with other cross then i get that indicator to work but other one reports 'zero divide'.
I suspect that my mt4 is corrupted or i have a virus.
Any one else have same problem ?I would like to avoid reinstallation...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2007, 05:59 AM
deepdrunk's Avatar
deepdrunk deepdrunk is offline
Senior Member
 
Join Date: Apr 2006
Posts: 310
deepdrunk is on a distinguished road
the indicators making problems are wccisqeezev2 and Fx sniper sidewinder overlay,they worked normal before
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2007, 09:05 AM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,432
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Some zero devide fixing example is here Firebird
May beit will help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2007, 12:10 PM
Linuxser's Avatar
Linuxser Linuxser is offline
Moderator
 
Join Date: May 2006
Location: Helliconia (Autumn)
Posts: 2,193
Linuxser has disabled reputation
Quote:
Originally Posted by deepdrunk
the indicators making problems are wccisqeezev2 and Fx sniper sidewinder overlay,they worked normal before

You´re right Deep

But old versions have the same problem.

I´ve tested with 195 and the same happens

Pls, try this one and compare if all is ok.

According with one explanation in MQL forum the best way to fix this is given a "if" condition to the calculus.

So.

We have:

Code:
diff = iATR(NULL,0,KCPeriod,i)*KCFactor;
std = iStdDev(NULL,0,BBPeriod,MODE_SMA,0,PRICE_CLOSE,i);   

bbs = BBDeviation * std / diff;

and change by

Code:
diff = iATR(NULL,0,KCPeriod,i)*KCFactor;
std = iStdDev(NULL,0,BBPeriod,MODE_SMA,0,PRICE_CLOSE,i);
    
if(diff>0) bbs = BBDeviation * std / diff;
Hope it works.
Attached Files
File Type: mq4 WCCISqueeze v2.1.mq4 (3.0 KB, 46 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2007, 02:35 PM
Mistigri's Avatar
Mistigri Mistigri is offline
Junior Member
 
Join Date: Mar 2006
Location: SLC
Posts: 22
Mistigri is on a distinguished road
Division By zero

I'm sure it has been posted many times, but here is how I usually handle div by zero errors:

bbs = BBDeviation * std / MathMax( diff, 0.000001 );

Hope this helps some.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-22-2007, 11:01 PM
deepdrunk's Avatar
deepdrunk deepdrunk is offline
Senior Member
 
Join Date: Apr 2006
Posts: 310
deepdrunk is on a distinguished road
Hi,

thank you all for help,WCCI v2.1 work,no more 'zero divide' errors.
Fxsniper sidewinder overlay is ex4 so i can't fix it but i wonder how it worked before without problems and now it is giving this error ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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



All times are GMT. The time now is 08:51 AM.