def price_sensitivity(results):
    """
    Calculate the price sensitivity of a strategy
    results
        results dataframe or any dataframe with the columns
        open, high, low, close, profit
    returns
        the percentage of returns sensitive to open price

    Note
    -----
    Price sensitivity is calculated by
     1) Calculating the profit in cases where open=high and open=low
     2) Dividing these profits by the total profits


    A high percentage indicates that most of your orders may not get
    executed at the LIMIT price since the stock tends have a sharp
    movement when open=low or open=high. A value of 1 indicates that
    all returns are sensitive to prices

    This is somewhat a rough measure and it doesn't take into account
    whether you BUY or SELL
    """
    profit = results["profit"].sum()
    sen1 = results.query("open==low")["profit"].sum()
    sen2 = results.query("open==high")["profit"].sum()
    return (sen1 + sen2) / profit