[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [GT] Problem with display_indicator/EMA/revision 599



João,
 
to solve this problem, these types of indicators could be patched as follows below. Try it out for EMA. In my installation it generates the full data for EMA. As you can see, the fix is quite simple, just search for the first day when the dependencies are satisfied, and narrow the interval to start there. If you reach the last day, then return the empty solution.
 
Th.
 
===================================================================
--- Indicators/EMA.pm (revision 631)
+++ Indicators/EMA.pm (working copy)
@@ -145,7 +145,11 @@
     # Don't need to calculate all SMA values, just the first data point.
     $self->{'start'}->calculate($calc, $first);
 
-    return unless $self->dependencies_are_available($calc, $first);
+    while (! $self->check_dependencies_interval($calc, $first, $last)) {
+      return if $first == $last;
+      $first++;
+      next;
+    }
 
     my $alpha = 2 / ($nb + 1);
 
 

________________________________

From: João Costa [mailto:joaocosta
AT
zonalivre.org]
Sent: Fri 7/25/2008 9:48 AM
To: devel
AT
geniustrader.org
Subject: Re: [GT] Problem with display_indicator/EMA/revision 599





So the real problem here i believe is what i described earlier as
point #2, and before I try to fix that I'd like to ask you again if
you have already fixed it, since you correctly described that problem
quite some time ago.



<<winmail.dat>>