def bin_freq(sl, pt, p, t_sr):
    """
    Given a trading rule characterized by the parameters {sl, pt, freq}, what's the number of bets/year needed to achieve a sharpe ratio
    :param sl:
    :param pt:
    :param p:
    :param t_sr:
    :return:
    """
    freq = (t_sr * (pt - sl)) ** 2 * p * (1 - p) / ((pt - sl) * p + sl) ** 2

    return freq