import csv


def into_CSVfile(data):
    """Write data into CSV file"""
    filename = data[0][0] + '_klines_' + data[0][1]
    CSVfile = open('data\{}.csv'.format(filename), 'w', newline='')
    kline_writer = csv.writer(CSVfile, delimiter=',')
    for kline in data:
        kline_writer.writerow(kline)
    CSVfile.close()
    return print('Your CSV file {} has been created.'.format(filename))