def get_data_by_name(obj, name):
    """Get data by name within indicators or strategies

    Parameters
    ----------
    obj: Indicator or Strategy instance
    name: str
        data mame

    Returns
    DataFeed
    """
    tgt_data = None
    for data in obj.datas:
        if data._name == name:
            tgt_data = data
            break
    if tgt_data is None:
        raise Exception(f'You should define data named {name}')
    else:
        return tgt_data