from functools import reduce


def calculate_adr(bars):
  """
  Given a series of bars from the IB client, calculates the ADR
  """
  total = reduce(
    lambda acc, bar: acc + (bar.high / bar.low),
    bars,
    0)

  return round(100 * ((total / len(bars)) - 1), 1)