I'm trying to calculate the RSI using the Poloniex API and PHP Trader EXtension. Here is what i have so far.
date_default_timezone_set( 'UTC' );
$api = new poloniex( 'xxxxxxx', 'xxxxx' );
$data = $api->getChartValues( 'BTC_LTC', strtotime( "-21 hours" ), time(), 300 );
print_r( $data);
$rsi = array();
foreach ( $data as $a )
{
$rsi[] = $a['close'];
}
$rsi = trader_rsi( array_reverse($rsi) , 14 );
The getChartValues calls the returnChartData API Function from Poloniex API. After running the script, the output RSI is completely different than the valid one.
What i'm doing wrong?