Subject: | Request to help with Finance-TA module |
Date: | Tue, 30 Jun 2015 23:23:53 +0530 |
To: | bug-Finance-TA [...] rt.cpan.org |
From: | "Naresh........" <katta.nareshbabu [...] gmail.com> |
Hi ,
I am working with Finance::TA module to calculate MACD using TA_MACD and I
am always getting empty list upon calling this function.
Below is the code that I used:
use Finance::TA;
use strict;
use warnings;
use Data::Dumper;
my @array = (64.43, 63.75, 63.68, 63.8, 62.82, 62.15, 61.41,61.73, 61.3,
61.59, 61.07, 62.09, 62.19, 61.95, 61.22, 61.54,
62.38,62.16,63.68,63.86,63.49, 64.03, 64.48, 64.64, 64.44, 65.02, 65.02,
65.94, 64.19, 64.05, 64, 64.43, 63.75, 63.68, 63.8, 62.82, 62.15,
61.41,61.73, 61.3, 61.59, 61.07, 62.09, 62.19, 61.95, 61.22, 61.54,
62.38,62.16,63.68,63.86,63.49, 64.03, 64.48, 64.64, 64.44, 65.02, 65.02,
65.94, 64.19, 64.05, 64);
my $startIndex = 0;
my $endIndex = 27;
my ($retCode, $begIdx, $outMACD, $outMACDSignal, $outMACDHist) =
TA_MACD($startIndex, $endIndex, \@array,12, 26, 9);
print "RetCode : $retCode\n";
print "OUTMACD:\n";
print Dumper($outMACD);
print Dumper($outMACDSignal);
Environment Details:
************************
perl 5, version 14, subversion 2 (v5.14.2) built for
x86_64-linux-gnu-thread-multi
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise
Request you to verify code and correct me if I am doing wrong.
Regards,
Naresh.