import pandas as pd
from .indicator import Indicator

_HIGH = 'high'
_LOW = 'low'
_CLOSE = 'close'
_TIME = 'time'


class RSI(Indicator):
    _NAME = 'rsi'

    def __init__(self, currency_pair='btc_jpy', period='1d', length=14):
        super().__init__(currency_pair, period)
        self._length = self._bounded_length(length)

    def request_data(self, count=100, to_epoch_time=None):
        candlesticks_df = self._get_candlesticks_df(count, to_epoch_time)

        rsi = self._exec_talib_func(candlesticks_df, price=_CLOSE, timeperiod=self._length).rename('rsi')
        formatted_rsi = self._formatting(candlesticks_df[_TIME], rsi)
        return formatted_rsi

    def _required_candlesticks_count(self, count):
        return self._bounded_count(count) + self._length

    @staticmethod
    def _formatting(time_df, rsi):
        rsi = pd.concat([time_df, rsi], axis=1).dropna()
        return rsi.astype(object).to_dict(orient='records')

@@ -51,69 +51,8 @@
 or%0A%0A
-_HIGH = 'high'%0A_LOW = 'low'%0A_CLOSE = 'close'%0A_TIME = 'time'%0A%0A
 %0Acla
@@ -460,14 +460,15 @@
 ice=
-_CLOSE
+'close'
 , ti
@@ -493,22 +493,8 @@
 gth)
-.rename('rsi')
 %0A   
@@ -550,15 +550,8 @@
 s_df
-%5B_TIME%5D
 , rs
@@ -700,89 +700,149 @@
     
-@staticmethod%0A    def _formatting(time_df, rsi):%0A        rsi = pd.concat(%5B
+def _formatting(self, candlesticks, rsi):%0A        rsi.rename(self.name, inplace=True)%0A        rsi_with_time = pd.concat(%5Bcandlesticks%5B'
 time
-_df
+'%5D
 , rs
@@ -856,36 +856,84 @@
 s=1)
-.dropna()%0A        return rsi
+%0A        rsi_with_time.dropna(inplace=True)%0A        dict_rsi = rsi_with_time
 .ast
@@ -970,8 +970,32 @@
 cords')%0A
+        return dict_rsi%0A

Edit rsi data formatting