I seem to get the correct RSI given the correct inputs. What happens
when it doesn't work? Are you comparing it to another RSI
calculation? Are you using the exact same input data?
Some of this may be covered in the FAQ: http://is.gd/6j6QH
On the other hand, if you found a bug, I'd want to get that fixed
immediately.
First I set the days to 14.
my $rsi = new Math::Business::RSI;
$rsi->set_days(14);
Then I get the historical data from finance.yahoo.com and I put the
closing price in an array and assign it to @closing_values.
$rsi->insert( @closing_values );
$q = $rsi->query;
Then I return $q.
$q does not match the same value as stockcharts.com givin days is
14.
RSI for OWW (orbitz) is 49.34 if you set days to 14. (as of saturday
jan 16)
However when I run my program $q = 33.
I also found that, at minimum, I have to give my array 28 values in
order for me to get a value back.
Also, has anyone else had a problem with building the closing_values
array? For some reason I have to give the array at least 28 values,
otherwise it wont compute the RSI and returns nothing.
On Jan 15, 5:42 am, Paul Miller <jett...@gmail.com> wrote:
A 14-day RSI also needs 15 (not 28) values in order to calculate the
first RSI. It will differ wildly from an RSI that has been given a
great deal more than 15 points though. This is, again, because of how
it's calculated. If you follow Wilder's formula using a spreadsheet,
you'll see what I mean.
Anyway, try it with all 25s...
use strict;
use Math::Business::RSI;
my $rsi = Math::Business::RSI->new(14)
$rsi->insert( map {25} 1 .. 14 );
print "undefined, literally\n" unless defined( $rsi->query );
$rsi->insert( 25 );
print "ahh, here we go: ", $rsi->query, "\n";
Should give you undefined, literally (because it's not defined yet)
and then 99.009900990099.
On Jan 17, 4:26 pm, Paul Miller <jett...@gmail.com> wrote:
> my $rsi = Math::Business::RSI->new(14)
Oops, also, Wilder defines these in terms of "alpha," which is kindof
like inverse days.
It'd have to be this to work:
my $rsi = Math::Business::RSI->new; $rsi->set_days(14);