import random

input_alpha = 'group_neutralize({} - {},bucket(rank({}),range="0.1,1,0.2"))'

data_sets = ['implied_volatility_call_10', 'implied_volatility_call_1080', 'implied_volatility_call_120', 'implied_volatility_call_150', 'implied_volatility_call_180', 'implied_volatility_call_20', 'implied_volatility_call_270', 'implied_volatility_call_30', 'implied_volatility_call_360', 'implied_volatility_call_60', 'implied_volatility_call_720', 'implied_volatility_call_90', 'implied_volatility_put_10', 'implied_volatility_put_1080', 'implied_volatility_put_120', 'implied_volatility_put_150', 'implied_volatility_put_180', 'implied_volatility_put_20', 'implied_volatility_put_270', 'implied_volatility_put_30', 'implied_volatility_put_360', 'implied_volatility_put_60', 'implied_volatility_put_720', 'implied_volatility_put_90']

max_count = 1000

repeat_count = 0

result_alpha = []

while True:
    if len(result_alpha) >= max_count:
        break

    modify_alpha = input_alpha.format(random.choice(data_sets), random.choice(data_sets),random.choice(data_sets))

    if modify_alpha not in result_alpha:
        result_alpha.append(modify_alpha)
    else:
        repeat_count += 1
        if repeat_count >= max_count:
            break

for alpha in result_alpha:
    print(alpha)
    print()

print(f'共生成 {len(result_alpha)} 个alpha')