Math::Business::EMA - Technical Analysis: Exponential Moving Average
use Math::Business::EMA; my $avg = new Math::Business::EMA; $avg->set_days(7); 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_ema = new Math::Business::EMA(10);
Paul Miller <jettero@cpan.org>
<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 © 2013 Paul Miller
This is released under the Artistic License. See perlartistic.
perl(1), Math::Business::EMA, Math::Business::StockMonkey, Math::Business::StockMonkey::FAQ, Math::Business::StockMonkey::CookBook
http://en.wikipedia.org/wiki/Exponential_moving_average
To install Math::Business::RSI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Business::RSI
CPAN shell
perl -MCPAN -e shell install Math::Business::RSI
For more information on module installation, please visit the detailed CPAN module installation guide.