NAME
Math::Business::WMA - Technical Analysis: Weighted Moving Average
SYNOPSIS
use Math::Business::WMA;
my $avg = new Math::Business::WMA;
$avg->set_days(8);
my @closing_values = qw(
3 4 4 5 6 5 6 5 5 5 5
6 6 6 6 7 7 7 8 8 8 8
);
# choose one:
$avg->insert( @closing_values );
$avg->insert( $_ ) for @closing_values;
if( defined(my $q = $avg->query) ) {
print "value: $q.\n";
} else {
print "value: n/a.\n";
}
For short, you can skip the set_days() by suppling the setting to new():
my $longer_avg = new Math::Business::WMA(10);
AUTHOR
Paul Miller <jettero@cpan.org>
I am using this software in my own projects... If you find bugs, please please please let me know.
I normally hang out on #perl on freenode, so you can try to get immediate gratification there if you like. irc://irc.freenode.net/perl
There is also a mailing list with very light traffic that you might want to join: http://groups.google.com/group/stockmonkey/.
COPYRIGHT
Copyright (c) 2010 Paul Miller
LICENSE
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
[This software may have had previous licenses, of which the current maintainer is completely unaware. If this is so, it is possible the above license is incorrect or invalid.]
SEE ALSO
perl(1), Math::Business::StockMonkey, Math::Business::StockMonkey::FAQ, Math::Business::StockMonkey::CookBook