class_docstr: Handles outputting results to the terminal.
      
docstr: 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
docstr_tok: ["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"]
code: 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
  
imports: import json
  import structlog
label_desc: Use image node_id 4 for calling the Output obj's underlying member method code with example usage: obj.to_json(results, market_pair) and returns: output