def to_json(self, results, market_pair):
        """Creates the JSON to output to the CLI

        Args:
            market_pair (str): Market pair that this message relates to.
            results (dict): The result of the completed analysis to output.

        Returns:
            str: Completed JSON message
        """

        logger.warn('WARNING: JSON output is deprecated and will be removed in a future version')

        for indicator_type in results:
            for indicator in results[indicator_type]:
                for index, analysis in enumerate(results[indicator_type][indicator]):
                    results[indicator_type][indicator][index]['result'] = analysis['result'].to_dict(
                        orient='records'
                    )[-1]

        formatted_results = { 'pair': market_pair, 'results': results }
        output = json.dumps(formatted_results)
        output += '\n'
        return output
Creates the JSON to output to the CLI

        Args:
            market_pair (str): Market pair that this message relates to.
            results (dict): The result of the completed analysis to output.

        Returns:
            str: Completed JSON message
        
app/outputs.py