-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Several Divide by zero exceptions #56
Comments
Same with the ADX. Still tracing the source of that one...
|
And DMI
|
I dare say there may be others, but I am running out of time as I am about to go away for work. Could refactor any divisions to something like;
|
@pahlot thanks for pointing out. I need some time to check all the indicator for the division. |
@lppkarl that's understandable. I was thinking about how to best test this along with expending on how we can use the indicators. I haven't got the time in the next few weeks but what I was thinking is to have a mechanism of discovery of and registration of indicators. something (very roughly like);
And then a discovery service to list each. This will allow us to have a common discoverable interface for custom implementations, and also register an indicator with a custom config value. So we could have something like; indicator.GetByName(name); etc This would then also allow us to run any new indicators against a common test, such as making sure there is no DivideByZero issue in one foul swoop. Just an idea. |
@pahlot Thanks for the idea, but i just want to make something clear. Do you mean we introduce an IDiscoverableIndicator, and make all Analyzables (the base of all indicators) implement this, and we create a test case to discover all these indicators and test the case? I am a bit confuse. |
Hi,
Working against 3.1;
after much digging I have found that if a price hasn't moved within a given period of time the CCI will cause a DivideByZero exception @ line 29 because the mean deviation is 0.
To reproduce:
`[TestMethod]
public void Expect_CCI_Exception()
{
var candles = new List();
for(int i = 0; i <= 100; i++)
{
candles.Add(new Candle()
{
Open = 0.03m,
Close = 0.03m
});
}
Assert.ThrowsException(() => candles.Cci(20));
The text was updated successfully, but these errors were encountered: