def analyze_breakout(self, historial_data, hot_thresh=0, cold_thresh=0): """Performs a momentum analysis on the historical data Args: historial_data (list): A matrix of historical OHCLV data. hot_thresh (float, optional): Defaults to 0. The threshold at which this might be good to purchase. cold_thresh (float, optional): Defaults to 0. The threshold at which this might be good to sell. Returns: dict: A dictionary containing a tuple of indicator values and booleans for buy / sell indication. """ breakout_analyzer = Breakout() period_count = 5 breakout_historical_data = historial_data[0:period_count] breakout_value = breakout_analyzer.get_breakout_value( breakout_historical_data) is_breaking_out = breakout_value >= hot_thresh breakout_data = { 'values': (breakout_value, ), 'is_hot': is_breaking_out, 'is_cold': False } return breakout_data
def analyze_breakout(self, coin_pair, period_count=5, time_unit='5m'): breakout_analyzer = Breakout() historical_data = self.exchange_aggregator.get_historical_data( coin_pair=coin_pair, period_count=period_count, time_unit=time_unit) breakout_value, is_breaking_out = breakout_analyzer.find_breakout(historical_data) return breakout_value, is_breaking_out
def analyze_breakout(self, market_pair, period_count=5, time_unit='5m'): breakout_analyzer = Breakout() historical_data = self.exchange_interface.get_historical_data( market_pair=market_pair, period_count=period_count, time_unit=time_unit) breakout_value, is_breaking_out = breakout_analyzer.find_breakout(historical_data) return breakout_value, is_breaking_out
def analyze_breakout(self, market_pair, exchange, hot_thresh=0, cold_thresh=0): breakout_analyzer = Breakout() period_count = 5 historical_data = self.minute_historical_data[0:period_count] breakout_value = breakout_analyzer.get_breakout_value(historical_data) is_breaking_out = breakout_value >= hot_thresh breakout_data = { 'values': (breakout_value,), 'is_hot': is_breaking_out, 'is_cold': False } return breakout_data
def analyze_breakout(self, historial_data, period_count=5, hot_thresh=None, cold_thresh=None): """Performs a momentum analysis on the historical data Args: historial_data (list): A matrix of historical OHCLV data. period_count (int, optional): Defaults to 5. The number of data points to consider for our simple moving average. hot_thresh (float, optional): Defaults to None. The threshold at which this might be good to purchase. cold_thresh (float, optional): Defaults to None. The threshold at which this might be good to sell. Returns: dict: A dictionary containing a tuple of indicator values and booleans for buy / sell indication. """ breakout_analyzer = Breakout() breakout_historical_data = historial_data[0:period_count] breakout_value = breakout_analyzer.get_breakout_value( breakout_historical_data) is_hot = False if hot_thresh is not None: is_hot = breakout_value > hot_thresh is_cold = False if cold_thresh is not None: is_cold = breakout_value < cold_thresh if math.isnan(breakout_value): breakout_value = None breakout_result_data = { 'values': (breakout_value, ), 'is_cold': is_cold, 'is_hot': is_hot } return breakout_result_data
def analyze_breakout(self, historial_data, hot_thresh=0, cold_thresh=0): breakout_analyzer = Breakout() period_count = 5 breakout_historical_data = historial_data[0:period_count] breakout_value = breakout_analyzer.get_breakout_value( breakout_historical_data) is_breaking_out = breakout_value >= hot_thresh breakout_data = { 'values': (breakout_value, ), 'is_hot': is_breaking_out, 'is_cold': False } return breakout_data
def analyze_breakout(self, market_pair, exchange): breakout_analyzer = Breakout() historical_data = self.__exchange_interface.get_historical_data( market_pair=market_pair, exchange=exchange, period_count=self.break_config['period_count'], time_unit=self.break_config['time_unit']) breakout_value = breakout_analyzer.get_breakout_value(historical_data) is_breaking_out = breakout_value >= self.break_config[ "breakout_threshold"] breakout_data = { 'value': breakout_value, 'is_breaking_out': is_breaking_out } return breakout_data