示例#1
0
def create_strategy_output_dir(**kwargs):

    strategy_class = kwargs['strategy_class']
    report_date = kwargs['report_date']

    strategy_output_folder = dn.get_directory_name(ext='strategy_output')

    if strategy_class == 'futures_butterfly':
        output_dir = strategy_output_folder + '/futures_butterfly/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'curve_pca':
         output_dir = strategy_output_folder + '/curve_pca/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'spread_carry':
         output_dir = strategy_output_folder + '/spread_carry/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'vcs':
         output_dir = strategy_output_folder + '/vcs/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'scv':
         output_dir = strategy_output_folder + '/scv/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'ifs':
         output_dir = strategy_output_folder + '/ifs/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'ibo':
         output_dir = strategy_output_folder + '/ibo/' + cu.get_directory_extension(report_date)

    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    return output_dir
示例#2
0
def create_strategy_output_dir(**kwargs):

    strategy_class = kwargs['strategy_class']
    report_date = kwargs['report_date']

    strategy_output_folder = dn.get_directory_name(ext='strategy_output')

    if strategy_class == 'futures_butterfly':
        output_dir = strategy_output_folder + '/futures_butterfly/' + cu.get_directory_extension(report_date)
    elif strategy_class == 'intraday_futures_experimental':
         output_dir = strategy_output_folder + '/ife/' + cu.get_directory_extension(report_date)
    else:
        output_dir = strategy_output_folder + '/' + strategy_class + '/' + cu.get_directory_extension(report_date)

    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    return output_dir
def get_dated_directory_extension(**kwargs):

    if 'folder_date' in kwargs.keys():
        folder_date = kwargs['folder_date']
    else:
        folder_date = exp.doubledate_shift_bus_days()

    if 'ext' not in kwargs.keys():
        print('Need to provide a valid ext !')
        return

    directory_name = get_directory_name(**kwargs)

    dated_directory_name = directory_name + '/' + cu.get_directory_extension(folder_date)

    if not os.path.exists(dated_directory_name):
        os.makedirs(dated_directory_name)

    return dated_directory_name
示例#4
0
def get_dated_directory_extension(**kwargs):

    if 'folder_date' in kwargs.keys():
        folder_date = kwargs['folder_date']
    else:
        folder_date = exp.doubledate_shift_bus_days()

    if 'ext' not in kwargs.keys():
        print('Need to provide a valid ext !')
        return

    directory_name = get_directory_name(**kwargs)

    dated_directory_name = directory_name + '/' + cu.get_directory_extension(
        folder_date)

    if not os.path.exists(dated_directory_name):
        os.makedirs(dated_directory_name)

    return dated_directory_name