Perl Math::Business::EMA help
- by Dustin
Script pulls data from mysql:
$DBI::result = $db->prepare(qq{
SELECT close
FROM $table
WHERE day <= '$DATE'
ORDER BY day DESC
LIMIT $EMA
});
$DBI::result->execute();
while($row = $DBI::result->fetchrow) {
print "$row\n";
};
with the following example results:
1.560
1.560
1.550...
But I need to work out the EMA using Math::Business::EMA; and I'm not sure how to calculate this while maintaining the accuracy. EMA is weighted and My lack of Perl knowledge is not helping.