Thread: zero divide
View Single Post
  #4 (permalink)  
Old 04-20-2007, 12:10 PM
Linuxser's Avatar
Linuxser Linuxser is offline
Moderator
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 2,504
Blog Entries: 8
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)
Reply With Quote