*3.4. Trading*

Once each trader in our simulation makes the decision to trade, they all share a similar framework for deciding volume and price of trade. We use trade price to refer to the dollar value at which a trader wishes to trade the stock, and trade volume to refer to the number of shares that the trader wants to trade. The decision to trade begins with the consideration of each trader's estimate of the movement of the current price away from the perceived value. We define movement as the absolute value of the following ratio:

$$\text{movement} = \left| \frac{\text{perceived value } - \text{ current price}}{\text{current price}} \right| \tag{1}$$

where the perceived value for the fundamental trader is the perceived fundamental value, for the technical trader is the 20-day MA, and for the statistical arbitrage/pairs trader is a maximum (if price is falling) or minimum price (if price is rising) of the related stock within the past 20 s. Thus, movement measures how far the stock is mispriced from the point of view of the individual trader (where the mispriced stock is the paired stock for the Pairs trader).

For a buy order, the volume is determined as follows:

$$\text{buy volume} = \text{base volume} \times \text{movement} \times \text{random} \times \text{risk},\tag{2}$$

and the price at which a buy order is executed is as follows:

$$\text{buy price} = \text{current price} + \text{movement} \times \text{random} \times \text{risk},\tag{3}$$

where base volume is an initial trade volume, and the parameter random accounts for unpredictable elements that may change from one trade to the next, like investor mood. Buy volume is subject to the trader's budget. If their budget is less than the cost of the volume of shares they wish to buy, then the volume is automatically truncated as needed. Random and risk considerations will determine the exact trade price in any given transaction.

For a sell order, the volume is determined as follows:

$$\text{shell volume} = \text{volume held} \times \text{movement} \times \text{random} \times \text{risk},\tag{4}$$

and the price at which a buy order is executed is as follows:

$$\text{shell price} = \text{current price} - \text{movement} \times \text{random} \times \text{risk},\tag{5}$$

where volume held is the number of shares of the stock that the trader currently owns. If the sell volume is greater than the amount currently held, then all the held shares are sold. Again, in this case as well, random and risk considerations will determine the exact trade price in any given transaction.

### *3.5. Evolution of the Price*

We implement a standard order book. Our order book is made up of two ordered lists, one for buy orders, and one for sell orders. The sell order list is ordered from low to high and the buy ordered list is ordered from high to low. When an order is placed it gets put into one of these two lists. All experiments start with the randomly generated start price as outlined in Section 3.1. Once a trade occurs, the price in the market is updated to the latest price at which the trade occurred.
