{'fraction_non_alphanumeric': 0.017777777777777778, 'fraction_numerical': 0.0, 'mean_word_length': 4.574257425742574, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Dynamic Programming Approach to Buying a Large Block of Security with Adaptive Safe Price

We consider the problem of dynamically trading a security over a finite time horizon. We assume that a trader has a “safe price” for the security, which is the highest price that the trader is willing to pay for this security in each time period. A trader’s order has both temporary (short term) and permanent (long term) impact on the security price and the security price may increase after the trader’s order, to a point where it is above the safe price. Given a safe price constraint for the current time period, we characterize the optimal policy for the trader to maximize the total number of securities he can buy over a fixed time horizon. In particular, we consider a greedy policy, which involves at each stage buying a quantity that drives the temporary price to the security safety price. We show that the greedy policy is not always optimal and provide conditions under which the greedy policy is optimal. We also provide bounds on the performance of the greedy policy relative to the performance of the optimal policy.