Beispiel #1
0
    def analyze_rsi(self, market_pair, exchange, hot_thresh=0, cold_thresh=0):
        rsi_analyzer = RelativeStrengthIndex()

        period_count = 14

        historical_data = self.day_historical_data[0:period_count]

        rsi_value = rsi_analyzer.get_rsi_value(historical_data, period_count)

        is_overbought = rsi_value >= cold_thresh
        is_oversold = rsi_value <= hot_thresh

        rsi_data = {
            'values': (rsi_value,),
            'is_cold': is_overbought,
            'is_hot': is_oversold
        }

        return rsi_data
Beispiel #2
0
    def analyze_rsi(self, market_pair, exchange):

        rsi_analyzer = RelativeStrengthIndex()

        historical_data = self.__exchange_interface.get_historical_data(
            market_pair=market_pair,
            exchange=exchange,
            period_count=self.rsi_config['period_count'],
            time_unit=self.rsi_config['time_unit'])

        rsi_value = rsi_analyzer.get_rsi_value(historical_data,
                                               self.rsi_config['period_count'])

        is_overbought = rsi_value >= self.rsi_config['overbought']
        is_oversold = rsi_value <= self.rsi_config['oversold']

        rsi_data = {
            'value': rsi_value,
            'is_overbought': is_overbought,
            'is_oversold': is_oversold
        }

        return rsi_data