PDL::Finance::TA is a perl module allowing the user to perform technical analysis on financial data stored as PDLs.
movavg() function takes two arguments,
a pdl object and the number of elements over which to calculate the moving average.
It can be invoked in two ways:
use PDL; use PDL::Finance::TA 'movavg'; my $ma_13 = $p->movavg(13); # the 13-day moving average my $ma_21 = movavg($p, 21); # the 21-day moving average
For a nice example on how to use moving averages and plot them see "movavg.pl" in examples.
Copyright (C) 2013-2014. Vikas N Kumar <firstname.lastname@example.org>. All Rights Reserved.
This is free software; You can redistribute it or modify it under the terms of Perl itself.