def is_hammer(rOpen, rLow, rClose, rHigh):
    return lower_wick_at_least_twice_real_body(rOpen, rLow, rClose
        ) and closed_in_top_half_of_range(rHigh, rLow, rClose)
Adding calculated column(s) to a dataframe in pandas