In this notebook, we will take a look at trading lists and trading trajectories. In particular, you will see how trading lists vary depending on your initial trading parameters. You will also see how to implement a trade list in a simulated trading environment. In this first section, we will see how trading lists vary according to the traders risk aversion, the number of trades, and the liquidation time. The code outputs the plot of the trading lists and the corresponding trading trajectory. It also prints the total number of shares sold, and the trading list telling us how many shares to sell at each trading step. In this example, since we want it to sell our shares in 60 trades, this is exactly what we see. We can change the traders risk aversion to see how the plots change. If I simulate a trader that wants to take a lot of risk, we can see that the plots now look very different. A trader that wants to take a lot of risk would rather sell his shares evenly across the liquidation period. This is exactly what we see by looking at the trade list. We can also simulate a trader that doesn’t like to take risk and see how the blocks change. We can see that the plots now are very different. A trader that doesn’t like to take risks would rather sell his shares quickly rather than to sell them out evenly over the entire liquidation period. This is exactly what we see in the trading list. In the second section, we will see how to implement a trading list. Once we have a trading list, we would like to implement it. What this means is that we would like to sell our shares in the stock market according to the trading list and see how much money we made or lost. To do this, we’re going to simulate the stock market with a very simple trading environment. The details of the simulated trading environment will be covered in another notebook. In this notebook, we will just take a look at some of its parameters. For example, we can see that we’re going to use an annual volatility of 12 percent. Below, we can see the parameters we’re going to use to calculate the trading list according to the Almgren and Chriss model, such as the total number of shares to sell, and the starting price per share. This code will implement a trade list in our simulated trading environment. Again, you can set the values for the traders risk aversion, the number of trades, and the liquidation time. The code will output the value of the implementation shortfall, which tells you how much money you made or lost by selling your shares according to the trade list. The code also outputs the plot of the impacted stock price. This impacted stock price reflects the effects of both the permanent and temporary market impacts. Each dot in the plot represents when a trade took place and the corresponding price per share at which the stocks were sold. We can change the parameters in the code to see how the implementation shortfall varies. We can see that for this level of traders risk aversion, we have an implementation shortfall of around $580,000, and the plot shows many trades. Now, we can simulate a trader that doesn’t like to take risk. We can see that now the implementation shortfall is around two million dollars. We can also see that the plot only shows a few trades. This is consistent with the fact that in this case, since the trader doesn’t like to take any risk, he wants to sell his shares as quickly as possible. Notice that as a consequence of selling his shares quickly, the stock price of the first trade is greatly impacted from its initial value of $50 because this is when most of the stocks are sold, as can be seen from the trading list that shows that most of the stocks were sold in the first trade. The last thing to notice is that implementing the same trading list for different random realizations of the simulated stock price will yield different values for the implementation shortfall. For example, given these trading parameters and this random seed, we get that the implementation shortfall is around $580,000. Now, if we leave all the trading parameters the same, but only change the random seed, I will get the same trading list. However, we can see that now the implementation shortfall is around minus $788,000. The negative sign indicates that this time we actually made money. We can see why this happened from the plot. Remember, the initial stock price was $50. As we can see from the plot, most of the trade took place when the stock price was above its initial value. Since we sold most of our shares at a higher price, that means that we actually made money. Notice that this happened simply because of random fluctuations in the stock price. So, even if we use the same trade list, we’re not always going to get the same implementation shortfall. This is why we had to re-frame the problem of finding the optimal strategy, not in terms of a single realization, but in terms of the average or the expected value of the shortfall.