NAME
Math::Business::HMA - Technical Analysis: Hull Moving Average
SYNOPSIS
use
Math::Business::HMA;
my
$avg
= new Math::Business::HMA;
$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) ) {
"value: $q.\n"
;
}
else
{
"value: n/a.\n"
;
}
For short, you can skip the set_days() by suppling the setting to new():
my
$longer_avg
= new Math::Business::HMA(10);
RESEARCHER
The Hull Moving Average was invented Alan Hull circa 1990[?].
An SMA can smooth data fairly well but tends to lag terribly. The HMA tries to smooth data quickly (without the lag) by averaging some weighted moving averages (Math::Business::WMA) of itself at various intervals.
THANKS
John Baker <johnb@listbrokers.com>
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. There is a mailing list with very light traffic that you might want to join: http://groups.google.com/group/stockmonkey/.
COPYRIGHT
Copyright © 2013 Paul Miller
LICENSE
This is released under the Artistic License. See perlartistic.
SEE ALSO
perl(1), Math::Business::StockMonkey, Math::Business::StockMonkey::FAQ, Math::Business::StockMonkey::CookBook