code: def my_record_vars(context, data):
      
  
      # Record our variables.
      record(leverage=context.account.leverage)
      record(positions=len(context.portfolio.positions))
      if 0 < len(context.age):
          MaxAge = context.age[max(
              list(context.age.keys()), key=(lambda k: context.age[k]))]
          print(MaxAge)
          record(MaxAge=MaxAge)
      record(LowestPrice=context.LowestPrice)
docs: Record variables at the end of each day.