def my_record_vars(context, data):
    """
    Record variables at the end of each day.
    """

    # 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)