code: def _calculate_mdd(series):
      """
      Calculate mdd
  
      :param series:
      :return:
      """
      return series - series.cummax()
  
imports: import pandas
  from ..graph import SubplotsGraph, BaseGraph
label_desc: Use image node_id 2 for calling a global function with example usage: _calculate_mdd(series) and returns: unknown