Forex



Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 04-20-2007, 12:09 AM
deepdrunk's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 312
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2007, 06:59 AM
deepdrunk's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 312
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 04-20-2007, 10:05 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,083
Blog Entries: 243
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 04-20-2007, 01:10 PM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 4,412
Blog Entries: 56
Linuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond repute
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, 113 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 04-20-2007, 03:35 PM
Mistigri's Avatar
Member
 
Join Date: Mar 2006
Posts: 34
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 04-23-2007, 12:01 AM
deepdrunk's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 312
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 09-18-2009, 02:19 PM
Member
 
Join Date: Apr 2008
Posts: 75
footy98 is on a distinguished road
Zero divide

Dear Guru,
I have download the history (3 years) from Alpari and using its MT4 to test my EA. It works. I do the same thing for IBFX. It shows me the error "zero divide" The funny thing is if I change the period to the latest month (i.e. backtest 1 month only), it works again in IBFX. Anyone knows what happen? I believe it is something related to the history downloaded.

Regards,
Happy Trading
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 09-18-2009, 05:46 PM
mladen's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,278
mladen is on a distinguished road
...

Zero divide error is exclusively a coding error. Metatrader does not provide a trap (or rather, that message is the trap, and since by definition divide by zero yields to undefined, they chose the terminate the code execution in such cases) for such errors, so if not dealt with within the code it will happen, sooner or later

Quote:
Originally Posted by footy98 View Post
Dear Guru,
I have download the history (3 years) from Alpari and using its MT4 to test my EA. It works. I do the same thing for IBFX. It shows me the error "zero divide" The funny thing is if I change the period to the latest month (i.e. backtest 1 month only), it works again in IBFX. Anyone knows what happen? I believe it is something related to the history downloaded.

Regards,
Happy Trading

Last edited by mladen; 09-18-2009 at 07:09 PM. Reason: some more explanation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 09-22-2009, 05:12 PM
quest's Avatar
Junior Member
 
Join Date: Sep 2008
Posts: 24
quest is on a distinguished road
WCCI Panel Hearth - ZERO DIVIDE

Hi, I have a problem with WCCI panel Heart v2. Indicator worked up until I tried it with another company operating Metatrader. How do you fix it?
Please help me, it's important for me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 09-22-2009, 08:56 PM
mladen's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,278
mladen is on a distinguished road
...

Find in the code every occurrence of division and add before every division a zero condition checking
Something like this :
PHP Code:
if (divisor!=0)
     
result dividend/divisor;
else 
result 0// or whatever result you prefer here since the result
                 // of division by 0 by definition is undefined 
about the "whatever result" : I prefer the 0 (since the result of division by 0 is undefined, 0 is one of the "valid" results) because it is neutral in the way that it does not assume the sign of the result (so one less assumption compared to +- whatever result)

Quote:
Originally Posted by quest View Post
Hi, I have a problem with WCCI panel Heart v2. Indicator worked up until I tried it with another company operating Metatrader. How do you fix it?
Please help me, it's important for me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
metatrader zero divide, Zero Divide, zero divide forex


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


All times are GMT. The time now is 01:31 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.